[][src]Struct slip_codec::Encoder

pub struct Encoder {}

SLIP encoder context

Implementations

impl Encoder[src]

pub fn new() -> Self[src]

Creates a new encoder context

pub fn encode(&mut self, buf: &[u8], sink: &mut dyn Write) -> Result<usize>[src]

Encodes the given buffer in a SLIP frame and forwards it to the sink.

Arguments

  • buf - input data buffer for encoding
  • sink - output object implementing the std::io::Write trait

Returns the number of bytes written to the sink.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.