aboutsummaryrefslogtreecommitdiff
path: root/src/message/signalproxy/translation/mod.rs
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2021-10-03 12:39:06 +0200
committerMax Audron <audron@cocaine.farm>2021-10-03 12:39:06 +0200
commit2e7f1ee492be200fe2fe1b6204d471adec1d656b (patch)
tree4bcd3ec610fd68cb4670fc274a8c7a8fd9af7261 /src/message/signalproxy/translation/mod.rs
parentstatetracker: remove druid-widget-nursery (diff)
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.
Diffstat (limited to 'src/message/signalproxy/translation/mod.rs')
-rw-r--r--src/message/signalproxy/translation/mod.rs11
1 files changed, 9 insertions, 2 deletions
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<Variant, Error = String>,
+ Self::Item: Into<Variant>,
+{
type Item;
fn to_network_map(&self) -> Self::Item;