diff options
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util.rs b/src/util.rs index 76d7ecf..186678d 100644 --- a/src/util.rs +++ b/src/util.rs @@ -25,9 +25,11 @@ pub type NetworkKey = sodiumoxide::crypto::auth::Key; /// 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 /// -/// The error code have no predefined meaning, it's up to you application to define their -/// semantic. -pub type AssociatedStream = Pin<Box<dyn Stream<Item = Result<Vec<u8>, u8>> + Send>>; +/// 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 AssociatedStream = Pin<Box<dyn Stream<Item = Packet> + Send>>; + +pub type Packet = Result<Vec<u8>, u8>; /// Utility function: encodes any serializable value in MessagePack binary format /// using the RMP library. |