Struct foca::BincodeCodec
source · pub struct BincodeCodec<O: Options>(pub O);
Expand description
BincodeCodec
encodes/decodes messages using bincode
.
This struct simply wraps a bincode::Options
type:
let codec =
foca::BincodeCodec(bincode::DefaultOptions::new());
Tuple Fields§
§0: O
Trait Implementations§
source§impl<O: Clone + Options> Clone for BincodeCodec<O>
impl<O: Clone + Options> Clone for BincodeCodec<O>
source§fn clone(&self) -> BincodeCodec<O>
fn clone(&self) -> BincodeCodec<O>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T, O> Codec<T> for BincodeCodec<O>
impl<T, O> Codec<T> for BincodeCodec<O>
§type Error = Box<ErrorKind>
type Error = Box<ErrorKind>
The codec error type. Will be wrapped by
crate::Error
.source§fn encode_header(
&mut self,
payload: &Header<T>,
buf: impl BufMut
) -> Result<(), Self::Error>
fn encode_header( &mut self, payload: &Header<T>, buf: impl BufMut ) -> Result<(), Self::Error>
Encodes a
foca::Header
into the given buffer.impl<O: Copy + Options> Copy for BincodeCodec<O>
Auto Trait Implementations§
impl<O> Freeze for BincodeCodec<O>where
O: Freeze,
impl<O> RefUnwindSafe for BincodeCodec<O>where
O: RefUnwindSafe,
impl<O> Send for BincodeCodec<O>where
O: Send,
impl<O> Sync for BincodeCodec<O>where
O: Sync,
impl<O> Unpin for BincodeCodec<O>where
O: Unpin,
impl<O> UnwindSafe for BincodeCodec<O>where
O: UnwindSafe,
Blanket Implementations§
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