aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs58
1 files changed, 39 insertions, 19 deletions
diff --git a/src/lib.rs b/src/lib.rs
index a2a3a25..e2f57c9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,4 @@
+#![feature(test)]
#![feature(external_doc)]
#![feature(doc_cfg)]
#![doc(include = "../README.md")]
@@ -26,32 +27,51 @@ pub mod error;
/// Framing impl to be used with [`tokio_util::codec::Framed`]
pub mod frame;
-use failure::Error;
+/// Traits for Serialization of objects
+pub mod serialize {
+ use failure::Error;
-/// Serialization of types and structs to the quassel byteprotocol
-pub trait Serialize {
- fn serialize(&self) -> Result<Vec<u8>, Error>;
-}
+ /// Serialization of types and structs to the quassel byteprotocol
+ pub trait Serialize {
+ fn serialize(&self) -> Result<Vec<u8>, Error>;
+ }
-/// Serialization of UTF-8 based Strings to the quassel byteprotocol
-pub trait SerializeUTF8 {
- fn serialize_utf8(&self) -> Result<Vec<u8>, Error>;
-}
+ /// Serialization of UTF-8 based Strings to the quassel byteprotocol
+ pub trait SerializeUTF8 {
+ fn serialize_utf8(&self) -> Result<Vec<u8>, Error>;
+ }
-/// Deserialization of types and structs to the quassel byteprotocol
-pub trait Deserialize {
- fn parse(b: &[u8]) -> Result<(usize, Self), Error>
- where
- Self: std::marker::Sized;
+ pub trait SerializeVariant {
+ fn serialize_variant(&self) -> Result<Vec<u8>, Error>;
+ }
}
-/// Deserialization of UTF-8 based Strings to the quassel byteprotocol
-pub trait DeserializeUTF8 {
- fn parse_utf8(b: &[u8]) -> Result<(usize, Self), Error>
- where
- Self: std::marker::Sized;
+/// Traits for parsing objects
+pub mod deserialize {
+ use failure::Error;
+
+ /// Deserialization of types and structs to the quassel byteprotocol
+ pub trait Deserialize {
+ fn parse(b: &[u8]) -> Result<(usize, Self), Error>
+ where
+ Self: std::marker::Sized;
+ }
+
+ /// Deserialization of UTF-8 based Strings to the quassel byteprotocol
+ pub trait DeserializeUTF8 {
+ fn parse_utf8(b: &[u8]) -> Result<(usize, Self), Error>
+ where
+ Self: std::marker::Sized;
+ }
+
+ pub trait DeserializeVariant {
+ fn parse_variant(b: &[u8]) -> Result<(usize, Self), Error>
+ where
+ Self: std::marker::Sized;
+ }
}
+use failure::Error;
/// HandshakeSerialize implements the serialization needed during the handhake phase.
///
/// The protocol has some minor differences during this phase compared to the regular parsing.
d>2021-09-28statetracker: cleanup codeMax Audron-29/+86 2021-09-28statetracker: first iteration of working rpc objectMax Audron-0/+709 2021-09-28rename override_type to typeMax Audron-7/+7 2021-07-31fix trailing semicolon match_variant macroMax Audron-1/+1 2021-07-31add doc for network translationMax Audron-0/+93 2021-07-25add Traits for syncable objectsMax Audron-48/+114 2021-07-21cleanup objects::TypesMax Audron-5/+35 2021-07-21add IgnoreListManagerMax Audron-0/+165 2021-07-21add cert-managerMax Audron-0/+32 2021-07-21add BufferViewManager and BufferViewConfigMax Audron-0/+95 2021-07-21migrate BufferSyncer to use Network derive and add to central TypesMax Audron-143/+22 2021-07-21rewrite network derive to work more consistentlyMax Audron-78/+90 2021-07-21fix wrong capitalization for HighlightRuleListMax Audron-2/+2 2021-07-21implement the Network trait generically for all inner Variant TypesMax Audron-1/+66 2021-07-21change IRC MessageType to be a bitflag instead of enumMax Audron-54/+94 2021-07-21fix network objectMax Audron-18/+24 2021-07-21minor docs and cleanupMax Audron-4/+8 2021-04-05WIP: impl more signalproxy objectsMax Audron-1000/+1621 2021-03-09WIP: impl signalproxy typesMax Audron-253/+376 2021-01-21add to and from network deriveMax Audron-42/+2767 2021-01-21reorganize tests and add quassel featuresMax Audron-551/+850 2021-01-04add example program: quasselproxyclientMax Audron-0/+280 2021-01-04random stuffMax Audron-2/+9 2021-01-04add more signalproxy objectsMax Audron-40/+120 2021-01-04add message parsing feature flagsMax Audron-43/+96 2021-01-04fix parsing of datetime when value is -1Max Audron-1/+9 2021-01-02update dependenciesMax Audron-267/+27 2021-01-02rework handshakemessage parsingMax Audron-141/+278 2020-10-16updateMax Audron-1553/+294 2020-10-16update paperworkMax Audron-487/+391