From 6da4613578f1effb371f4f3dd6605c1dff16b0b7 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Mon, 29 Nov 2021 14:18:30 +0100 Subject: rework SyncProxy to use globally available channels the SyncProxy is now a globally available OnceCell that transparently offers a struct with methods to send syncmessages and rpccalls. This allows me to get rid of the globally passed around syncproxy var. The Syncable trait provides default implementations that access this global so the library user usually does not need to use it directly. Further the Syncable trait now provides default implementations for it's methods and only a const for the CLASS name must be set. It isn't very idiomatic rust and takes away some freedom from the library user but i think that it's an overall nicer solution and simplifies the code big time. --- src/message/signalproxy/initdata.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/message/signalproxy/initdata.rs') diff --git a/src/message/signalproxy/initdata.rs b/src/message/signalproxy/initdata.rs index 9e54690..a391b4a 100644 --- a/src/message/signalproxy/initdata.rs +++ b/src/message/signalproxy/initdata.rs @@ -32,13 +32,14 @@ impl Deserialize for InitData { res.remove(0); let class_name: String = res.remove(0).into(); + let object_name: String = res.remove(0).into(); Ok(( size, Self { class_name: class_name.clone(), - object_name: res.remove(0).into(), - init_data: Types::from_network(class_name.as_str(), &mut res), + object_name: object_name.clone(), + init_data: Types::from_network(class_name.as_str(), object_name.as_str(), &mut res), }, )) } -- cgit v1.2.3