Skip to main content

ByteDelimitedDecoderEnv

Struct ByteDelimitedDecoderEnv 

Source
pub struct ByteDelimitedDecoderEnv<T, S, R>
where T: Clone + Send + 'static, S: Send + Serialize + for<'a> Deserialize<'a>, R: Send + Serialize + for<'a> Deserialize<'a>,
{ /* private fields */ }
Expand description

Packet decoder environment.

Implementations§

Source§

impl<T, S, R> ByteDelimitedDecoderEnv<T, S, R>
where T: Clone + Send + 'static, S: Send + Serialize + for<'a> Deserialize<'a>, R: Send + Serialize + for<'a> Deserialize<'a>,

Source

pub fn new<F>(decode: F) -> Self
where F: Fn(&mut R, &[u8]) -> T + Send + 'static,

Creates new byte delimited decoder environment.

Source

pub fn with_transform<F, G>(transform: F, decode: G) -> Self
where F: Fn(&mut S, &[u8], u8) -> Result<Transformed, T> + Send + 'static, G: Fn(&mut R, &[u8]) -> T + Send + 'static,

Creates new byte delimited decoder environment with character transform function.

Trait Implementations§

Source§

impl<T, S, R> Debug for ByteDelimitedDecoderEnv<T, S, R>
where T: Clone + Send + 'static, S: Send + Serialize + for<'a> Deserialize<'a>, R: Send + Serialize + for<'a> Deserialize<'a>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, S, R> !RefUnwindSafe for ByteDelimitedDecoderEnv<T, S, R>

§

impl<T, S, R> !Sync for ByteDelimitedDecoderEnv<T, S, R>

§

impl<T, S, R> !UnwindSafe for ByteDelimitedDecoderEnv<T, S, R>

§

impl<T, S, R> Freeze for ByteDelimitedDecoderEnv<T, S, R>
where Box<dyn Fn(&mut S, &[u8], u8) -> Result<Transformed, T> + Send>: Freeze, Box<dyn Fn(&mut R, &[u8]) -> T + Send>: Freeze,

§

impl<T, S, R> Send for ByteDelimitedDecoderEnv<T, S, R>
where Box<dyn Fn(&mut S, &[u8], u8) -> Result<Transformed, T> + Send>: Send, Box<dyn Fn(&mut R, &[u8]) -> T + Send>: Send,

§

impl<T, S, R> Unpin for ByteDelimitedDecoderEnv<T, S, R>
where Box<dyn Fn(&mut S, &[u8], u8) -> Result<Transformed, T> + Send>: Unpin, Box<dyn Fn(&mut R, &[u8]) -> T + Send>: Unpin,

§

impl<T, S, R> UnsafeUnpin for ByteDelimitedDecoderEnv<T, S, R>
where Box<dyn Fn(&mut S, &[u8], u8) -> Result<Transformed, T> + Send>: UnsafeUnpin, Box<dyn Fn(&mut R, &[u8]) -> T + Send>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.