From 2e7f1ee492be200fe2fe1b6204d471adec1d656b Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sun, 3 Oct 2021 12:39:06 +0200 Subject: split StatefulSyncable into client and server side traits This allows to more easily put each side behind a feature flag, maintaing ease of use when only one is selected, while still allowing a consumer to enable both sides and use them. --- src/message/signalproxy/translation/mod.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/message/signalproxy/translation/mod.rs') diff --git a/src/message/signalproxy/translation/mod.rs b/src/message/signalproxy/translation/mod.rs index f6bbbb9..a6e26b4 100644 --- a/src/message/signalproxy/translation/mod.rs +++ b/src/message/signalproxy/translation/mod.rs @@ -1,3 +1,5 @@ +use std::convert::TryFrom; + /** Quassel has 3 main ways to represent an object over the Network: @@ -84,7 +86,7 @@ VariantMap({ }) ``` **/ -use crate::primitive::VariantList; +use crate::primitive::{Variant, VariantList}; pub trait Network { type Item; @@ -93,7 +95,12 @@ pub trait Network { fn from_network(input: &mut Self::Item) -> Self; } -pub trait NetworkMap { +pub trait NetworkMap +where + // TODO correct this error type + Self::Item: TryFrom, + Self::Item: Into, +{ type Item; fn to_network_map(&self) -> Self::Item; -- cgit v1.2.3