Struct distant_net::common::ChainCodec
source · pub struct ChainCodec<T, U> { /* private fields */ }Expand description
Represents a codec that chains together other codecs such that encoding will call the encode methods of the underlying, chained codecs from left-to-right and decoding will call the decode methods in reverse order
Implementations
sourceimpl<T, U> ChainCodec<T, U>
impl<T, U> ChainCodec<T, U>
sourcepub fn new(left: T, right: U) -> Self
pub fn new(left: T, right: U) -> Self
Chains two codecs together such that left will be invoked first during encoding and
right will be invoked first during decoding
sourcepub fn into_right(self) -> U
pub fn into_right(self) -> U
Consumes the chain and returns the right codec
sourcepub fn into_left_right(self) -> (T, U)
pub fn into_left_right(self) -> (T, U)
Consumes the chain and returns the left and right codecs
Trait Implementations
sourceimpl<T: Clone, U: Clone> Clone for ChainCodec<T, U>
impl<T: Clone, U: Clone> Clone for ChainCodec<T, U>
sourcefn clone(&self) -> ChainCodec<T, U>
fn clone(&self) -> ChainCodec<T, U>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl<T: Debug, U: Debug> Debug for ChainCodec<T, U>
impl<T: Debug, U: Debug> Debug for ChainCodec<T, U>
sourceimpl<T: Default, U: Default> Default for ChainCodec<T, U>
impl<T: Default, U: Default> Default for ChainCodec<T, U>
sourcefn default() -> ChainCodec<T, U>
fn default() -> ChainCodec<T, U>
Returns the “default value” for a type. Read more
sourceimpl<T: PartialEq, U: PartialEq> PartialEq<ChainCodec<T, U>> for ChainCodec<T, U>
impl<T: PartialEq, U: PartialEq> PartialEq<ChainCodec<T, U>> for ChainCodec<T, U>
sourcefn eq(&self, other: &ChainCodec<T, U>) -> bool
fn eq(&self, other: &ChainCodec<T, U>) -> bool
impl<T: Copy, U: Copy> Copy for ChainCodec<T, U>
impl<T: Eq, U: Eq> Eq for ChainCodec<T, U>
impl<T, U> StructuralEq for ChainCodec<T, U>
impl<T, U> StructuralPartialEq for ChainCodec<T, U>
Auto Trait Implementations
impl<T, U> RefUnwindSafe for ChainCodec<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for ChainCodec<T, U>where
T: Send,
U: Send,
impl<T, U> Sync for ChainCodec<T, U>where
T: Sync,
U: Sync,
impl<T, U> Unpin for ChainCodec<T, U>where
T: Unpin,
U: Unpin,
impl<T, U> UnwindSafe for ChainCodec<T, U>where
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more