pub struct CborTransport<S> { /* private fields */ }Expand description
A wrapper around NoiseTransport that provides CBOR message sending/receiving with length-prefixed framing (4-byte big-endian length prefix + encrypted payload).
Implementations§
Source§impl<S> CborTransport<S>
impl<S> CborTransport<S>
pub fn new(transport: NoiseTransport, stream: S) -> Self
pub async fn send<T: Serialize>( &mut self, message: &T, ) -> Result<(), Box<dyn Error>>
pub async fn receive<T: for<'de> Deserialize<'de>>( &mut self, ) -> Result<T, Box<dyn Error>>
pub fn transport(&self) -> &NoiseTransport
pub fn transport_mut(&mut self) -> &mut NoiseTransport
Auto Trait Implementations§
impl<S> !RefUnwindSafe for CborTransport<S>
impl<S> !UnwindSafe for CborTransport<S>
impl<S> Freeze for CborTransport<S>where
S: Freeze,
impl<S> Send for CborTransport<S>where
S: Send,
impl<S> Sync for CborTransport<S>where
S: Sync,
impl<S> Unpin for CborTransport<S>where
S: Unpin,
impl<S> UnsafeUnpin for CborTransport<S>where
S: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more