diff options
author | Alex Auvolat <alex@adnab.me> | 2022-07-21 18:15:07 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-07-21 18:15:07 +0200 |
commit | 26989bba1409bfc093e58ef98e75885b10ad7c1c (patch) | |
tree | 92c53f668f1c5d197df026d96bbf4a0cdb7c2bbb /src/util.rs | |
parent | 9dffa812c43470ee8a29c23c3a1be73085e25843 (diff) | |
download | netapp-26989bba1409bfc093e58ef98e75885b10ad7c1c.tar.gz netapp-26989bba1409bfc093e58ef98e75885b10ad7c1c.zip |
Use Bytes instead of Vec<u8>
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs index 6fbafe6..e81a89c 100644 --- a/src/util.rs +++ b/src/util.rs @@ -4,6 +4,7 @@ use std::pin::Pin; use log::info; use serde::Serialize; +use bytes::Bytes; use futures::Stream; use tokio::sync::watch; @@ -27,7 +28,7 @@ pub type NetworkKey = sodiumoxide::crypto::auth::Key; /// meaning, it's up to your application to define their semantic. pub type ByteStream = Pin<Box<dyn Stream<Item = Packet> + Send>>; -pub type Packet = Result<Vec<u8>, u8>; +pub type Packet = Result<Bytes, u8>; /// Utility function: encodes any serializable value in MessagePack binary format /// using the RMP library. |