diff options
author | Alex Auvolat <alex@adnab.me> | 2022-07-22 12:45:38 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-07-22 12:45:38 +0200 |
commit | 0b71ca12f910c17eaf2291076438dff3b70dc9cd (patch) | |
tree | 28c4239938b1bd585052c9a1b8b6a752b9c3bbe0 /src/util.rs | |
parent | c358fe3c92da8a8454e461484737efe2a14dfd73 (diff) | |
download | netapp-0b71ca12f910c17eaf2291076438dff3b70dc9cd.tar.gz netapp-0b71ca12f910c17eaf2291076438dff3b70dc9cd.zip |
Clean up framing protocol
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/util.rs b/src/util.rs index 01c392c..13cccb9 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,12 +1,9 @@ use std::net::SocketAddr; use std::net::ToSocketAddrs; -use std::pin::Pin; -use bytes::Bytes; use log::info; use serde::Serialize; -use futures::Stream; use tokio::sync::watch; /// A node's identifier, which is also its public cryptographic key @@ -16,18 +13,6 @@ pub type NodeKey = sodiumoxide::crypto::sign::ed25519::SecretKey; /// A network key pub type NetworkKey = sodiumoxide::crypto::auth::Key; -/// A stream of associated data. -/// -/// The Stream can continue after receiving an error. -/// When sent through Netapp, the Vec may be split in smaller chunk in such a way -/// consecutive Vec may get merged, but Vec and error code may not be reordered -/// -/// Error code 255 means the stream was cut before its end. Other codes have no predefined -/// meaning, it's up to your application to define their semantic. -pub type ByteStream = Pin<Box<dyn Stream<Item = Packet> + Send + Sync>>; - -pub type Packet = Result<Bytes, u8>; - /// Utility function: encodes any serializable value in MessagePack binary format /// using the RMP library. /// |