pub trait ToBytes<W>where
W: Write,{
// Required method
fn to_bytes(&self, writer: &mut W) -> Result<()>;
}Expand description
A trait for converting a value to bytes.
Required Methods§
Implementations on Foreign Types§
Source§impl<W> ToBytes<W> for &strwhere
W: Write,
Encode a str into bytes.
impl<W> ToBytes<W> for &strwhere
W: Write,
Encode a str into bytes.
Decoder is decoders::binary::string.
Source§impl<W> ToBytes<W> for u8where
W: Write,
Encode a u8 into a byte (well, it’s already a byte!).
impl<W> ToBytes<W> for u8where
W: Write,
Encode a u8 into a byte (well, it’s already a byte!).
Source§impl<W> ToBytes<W> for u64where
W: Write,
Encode a u64 into bytes with a LEB128 representation.
impl<W> ToBytes<W> for u64where
W: Write,
Encode a u64 into bytes with a LEB128 representation.
Decoder is decoders::binary::uleb.
Source§impl<W> ToBytes<W> for Stringwhere
W: Write,
Encode a String into bytes.
impl<W> ToBytes<W> for Stringwhere
W: Write,
Encode a String into bytes.
Decoder is decoders::binary::string.
Source§impl<W, I> ToBytes<W> for Vec<I>
Encode a vector into bytes.
impl<W, I> ToBytes<W> for Vec<I>
Encode a vector into bytes.
Decoder is decoders::binary::list.