diff options
| author | Max Audron <audron@cocaine.farm> | 2021-10-01 18:13:43 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2021-10-01 18:17:03 +0200 |
| commit | 8465010f3cb51d672b60df39a7dfd34624ab5c7c (patch) | |
| tree | 062d8640f7e7c4aea2a2e4029ea742982ba20911 /src/message/signalproxy/mod.rs | |
| parent | adapt Sync* types (diff) | |
migrate to separated NetworkMap and NetworkList macros
Diffstat (limited to 'src/message/signalproxy/mod.rs')
| -rw-r--r-- | src/message/signalproxy/mod.rs | 21 |
1 files changed, 13 insertions, 8 deletions
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 +// <T as Iterator>::Item: ToString, +where + Variant: From<<Self as translation::NetworkMap>::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: <Self as translation::NetworkMap>::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: <Self as translation::NetworkMap>::Item, + ) where Self: Sized, { #[cfg(feature = "client")] |
