diff options
| author | Max Audron <audron@cocaine.farm> | 2021-03-09 17:18:22 +0100 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2021-03-09 17:18:22 +0100 |
| commit | 57e0309994be634f3935cf981d4b1ce60b481aba (patch) | |
| tree | b6a5f9cfc28e6aa7ce4e6b9bbc41faa76003984e /src/primitive/variant.rs | |
| parent | add to and from network derive (diff) | |
WIP: impl signalproxy types
Diffstat (limited to '')
| -rw-r--r-- | src/primitive/variant.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/primitive/variant.rs b/src/primitive/variant.rs index e9e032e..8a98d59 100644 --- a/src/primitive/variant.rs +++ b/src/primitive/variant.rs @@ -12,6 +12,8 @@ use crate::{Serialize, SerializeUTF8}; use crate::primitive::{BufferInfo, Date, DateTime, Message, Time, VariantList, VariantMap}; +use libquassel_derive::From; + /// Variant represents the possible types we can receive /// /// Variant's are serizalized as the Type as a i32 and then the Type in it's own format @@ -21,9 +23,10 @@ use crate::primitive::{BufferInfo, Date, DateTime, Message, Time, VariantList, V /// /// ByteArray is de-/serialized as a C ByteArray. #[allow(non_camel_case_types, dead_code)] -#[derive(Clone, Debug, std::cmp::PartialEq)] +#[derive(Clone, Debug, PartialEq, From)] pub enum Variant { Unknown, + #[from(ignore)] UserType(String, Vec<u8>), BufferInfo(BufferInfo), Message(Message), @@ -33,6 +36,7 @@ pub enum Variant { VariantMap(VariantMap), VariantList(VariantList), String(String), + #[from(ignore)] ByteArray(String), StringList(StringList), bool(bool), |
