[][src]Trait it_to_bytes::ToBytes

pub trait ToBytes<W> where
    W: Write
{ pub fn to_bytes(&self, writer: &mut W) -> Result<()>; }

A trait for converting a value to bytes.

Required methods

pub fn to_bytes(&self, writer: &mut W) -> Result<()>[src]

Converts the given value into &[u8] in the given writer.

Loading content...

Implementations on Foreign Types

impl<W> ToBytes<W> for u8 where
    W: Write
[src]

Encode a u8 into a byte (well, it's already a byte!).

impl<W> ToBytes<W> for u64 where
    W: Write
[src]

Encode a u64 into bytes with a LEB128 representation.

Decoder is decoders::binary::uleb.

impl<W> ToBytes<W> for &str where
    W: Write
[src]

Encode a str into bytes.

Decoder is decoders::binary::string.

impl<W> ToBytes<W> for String where
    W: Write
[src]

Encode a String into bytes.

Decoder is decoders::binary::string.

impl<W, I> ToBytes<W> for Vec<I> where
    W: Write,
    I: ToBytes<W>, 
[src]

Encode a vector into bytes.

Decoder is decoders::binary::list.

Loading content...

Implementors

Loading content...