Struct rs9p::serialize::Encoder[][src]

pub struct Encoder<W> { /* fields omitted */ }

A wrapper class of WriteBytesExt to provide operator overloads for serializing

Operator ‘<<’ serializes the right hand side argument into the left hand side encoder

Implementations

impl<W: WriteBytesExt> Encoder<W>[src]

pub fn new(writer: W) -> Encoder<W>[src]

pub fn bytes_written(&self) -> usize[src]

Return total bytes written

pub fn encode<T: Encodable>(&mut self, data: &T) -> Result<usize>[src]

Encode data, equivalent to: decoder << data

pub fn into_inner(self) -> W[src]

Get inner writer

Trait Implementations

impl<W: Clone> Clone for Encoder<W>[src]

impl<W: Debug> Debug for Encoder<W>[src]

impl<'a, T: Encodable, W: WriteBytesExt> Shl<&'a T> for Encoder<W>[src]

type Output = SResult<Encoder<W>>

The resulting type after applying the << operator.

Auto Trait Implementations

impl<W> RefUnwindSafe for Encoder<W> where
    W: RefUnwindSafe

impl<W> Send for Encoder<W> where
    W: Send

impl<W> Sync for Encoder<W> where
    W: Sync

impl<W> Unpin for Encoder<W> where
    W: Unpin

impl<W> UnwindSafe for Encoder<W> where
    W: UnwindSafe

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.