From 8465010f3cb51d672b60df39a7dfd34624ab5c7c Mon Sep 17 00:00:00 2001 From: Max Audron Date: Fri, 1 Oct 2021 18:13:43 +0200 Subject: migrate to separated NetworkMap and NetworkList macros --- src/message/signalproxy/mod.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/message/signalproxy/mod.rs') diff --git a/src/message/signalproxy/mod.rs b/src/message/signalproxy/mod.rs index 41057ca..d5cdd80 100644 --- a/src/message/signalproxy/mod.rs +++ b/src/message/signalproxy/mod.rs @@ -1,10 +1,7 @@ -use std::convert::TryInto; - use crate::{ deserialize::Deserialize, - primitive::{VariantList, VariantMap}, + primitive::{Variant, VariantList}, serialize::Serialize, - session::Session, }; use num_derive::{FromPrimitive, ToPrimitive}; @@ -63,9 +60,14 @@ pub trait Syncable { /// A Stateful Syncable Object #[allow(unused_variables)] -pub trait StatefulSyncable: Syncable + translation::NetworkMap { +pub trait StatefulSyncable: Syncable + translation::NetworkMap +// where +// ::Item: ToString, +where + Variant: From<::Item>, +{ /// Client -> Server: Update the whole object with received data - fn update(&mut self, session: impl SyncProxy, param: VariantMap) + fn update(&mut self, session: impl SyncProxy, param: ::Item) where Self: Sized, { @@ -80,8 +82,11 @@ pub trait StatefulSyncable: Syncable + translation::NetworkMap { } /// Server -> Client: Update the whole object with received data - fn request_update(&mut self, session: impl SyncProxy, mut param: VariantMap) - where + fn request_update( + &mut self, + session: impl SyncProxy, + mut param: ::Item, + ) where Self: Sized, { #[cfg(feature = "client")] -- cgit v1.2.3