From a23c1721eb73b20212716a38c052a41eb5960b83 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Wed, 1 Dec 2021 16:21:43 +0100 Subject: complete BufferViewConfig implementation --- src/message/signalproxy/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/message/signalproxy/mod.rs') diff --git a/src/message/signalproxy/mod.rs b/src/message/signalproxy/mod.rs index d6490d4..dab57c2 100644 --- a/src/message/signalproxy/mod.rs +++ b/src/message/signalproxy/mod.rs @@ -66,22 +66,24 @@ impl SyncProxy { } /// Send an RpcCall - fn rpc(&self, function: &str, params: VariantList) {} + fn rpc(&self, _function: &str, _params: VariantList) {} } /// A base Syncable Object /// /// Provides default implementations for sending SyncMessages and -/// RpcCalls so you usually only have to set the CLASS const +/// RpcCalls so you usually only have to set the CLASS const. +/// +/// If the object name has to be set implement the send_sync() function. pub trait Syncable { /// The Class of the object as transmitted in the SyncMessage const CLASS: &'static str; /// Send a SyncMessage. - fn send_sync(&self, object_name: Option<&str>, function: &str, params: VariantList) { + fn send_sync(&self, function: &str, params: VariantList) { crate::message::signalproxy::SYNC_PROXY.get().unwrap().sync( Self::CLASS, - object_name, + None, function, params, ); @@ -128,7 +130,7 @@ where where Self: Sized, { - self.send_sync(None, "update", vec![self.to_network_map().into()]); + self.send_sync("update", vec![self.to_network_map().into()]); } /// Server -> Client: Update the whole object with received data @@ -176,7 +178,7 @@ pub trait StatefulSyncableClient: Syncable + translation::NetworkMap { where Self: Sized, { - self.send_sync(None, "requestUpdate", vec![self.to_network_map().into()]); + self.send_sync("requestUpdate", vec![self.to_network_map().into()]); } } -- cgit v1.2.3