diff options
| author | Max Audron <audron@cocaine.farm> | 2025-02-26 17:53:08 +0100 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2025-02-26 17:53:08 +0100 |
| commit | 6f9c0d0f2906d05e27f9f11af6cefdf006c2cf4b (patch) | |
| tree | 3c92d681f8c98786bf7371ecfece60ed4f8d4a7c /src/primitive/stringlist.rs | |
| parent | add MsgId and BufferId to objects where needed (diff) | |
refactor variant serialization code
Factored out a lot of the serialization of variants into trait's that
have auto impl so code duplication is much reduced
Diffstat (limited to '')
| -rw-r--r-- | src/primitive/stringlist.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/primitive/stringlist.rs b/src/primitive/stringlist.rs index 872f5be..f76e95d 100644 --- a/src/primitive/stringlist.rs +++ b/src/primitive/stringlist.rs @@ -7,6 +7,8 @@ use log::trace; use crate::{deserialize::*, error::ProtocolError, serialize::*}; +use crate::serialize::SerializeVariant; + /// StringList are represented as a Vec of Strings /// /// StringLists are serialized as an i32 of the amount of elements and then each element as a String @@ -45,6 +47,10 @@ impl Deserialize for StringList { } } +impl SerializeVariant for StringList { + const TYPE: u32 = crate::primitive::QSTRINGLIST; +} + #[test] pub fn string_list_serialize() { let mut test_list = StringList::new(); |
