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§
source§impl<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§
source§impl<T: Clone, U: Clone> Clone for ChainCodec<T, U>
 
impl<T: Clone, U: Clone> Clone for ChainCodec<T, U>
source§fn clone(&self) -> ChainCodec<T, U>
 
fn clone(&self) -> ChainCodec<T, U>
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: Default, U: Default> Default for ChainCodec<T, U>
 
impl<T: Default, U: Default> Default for ChainCodec<T, U>
source§fn default() -> ChainCodec<T, U>
 
fn default() -> ChainCodec<T, U>
Returns the “default value” for a type. Read more
source§impl<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>
source§fn eq(&self, other: &ChainCodec<T, U>) -> bool
 
fn eq(&self, other: &ChainCodec<T, U>) -> bool
This method tests for 
self and other values to be equal, and is used
by ==.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§
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
source§impl<C> CodecExt for Cwhere
    C: Codec,
 
impl<C> CodecExt for Cwhere C: Codec,
source§fn chain<T>(self, codec: T) -> ChainCodec<C, T>
 
fn chain<T>(self, codec: T) -> ChainCodec<C, T>
Chains this codec with another codec