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/objects/bufferview.rs | |
| parent | adapt Sync* types (diff) | |
migrate to separated NetworkMap and NetworkList macros
Diffstat (limited to 'src/message/signalproxy/objects/bufferview.rs')
| -rw-r--r-- | src/message/signalproxy/objects/bufferview.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/message/signalproxy/objects/bufferview.rs b/src/message/signalproxy/objects/bufferview.rs index 512a5b9..5ac608c 100644 --- a/src/message/signalproxy/objects/bufferview.rs +++ b/src/message/signalproxy/objects/bufferview.rs @@ -1,6 +1,8 @@ -use libquassel_derive::Network; use std::{collections::HashMap, convert::TryInto}; +use libquassel_derive::NetworkList; + +use crate::message::signalproxy::translation::Network; use crate::primitive::{Variant, VariantList}; #[derive(Debug, Clone, PartialEq)] @@ -27,10 +29,8 @@ pub struct BufferViewManager { // update(properties: QVariantMap) } -impl super::Network for BufferViewManager { - type Item = VariantList; - - fn to_network(&self) -> Self::Item { +impl super::NetworkList for BufferViewManager { + fn to_network_list(&self) -> VariantList { let mut res = Vec::with_capacity(2); res.push(Variant::ByteArray(s!("bufferViewIds"))); @@ -44,7 +44,7 @@ impl super::Network for BufferViewManager { return res; } - fn from_network(_input: &mut Self::Item) -> Self { + fn from_network_list(_input: &mut VariantList) -> Self { // TODO Somehow do the initrequests for all the IDs we get here Self { buffer_view_configs: HashMap::new(), @@ -52,8 +52,7 @@ impl super::Network for BufferViewManager { } } -#[derive(Debug, Clone, PartialEq, Network)] -#[network(repr = "list")] +#[derive(Debug, Clone, PartialEq, NetworkList)] pub struct BufferViewConfig { #[network(rename = "BufferList", network, variant = "VariantList")] pub buffers: Vec<i32>, |
