Trait casper_types::bytesrepr::ToBytes[][src]

pub trait ToBytes {
    fn to_bytes(&self) -> Result<Vec<u8>, Error>;
fn serialized_length(&self) -> usize; fn into_bytes(self) -> Result<Vec<u8>, Error>
    where
        Self: Sized
, { ... } }
Expand description

A type which can be serialized to a Vec<u8>.

Required methods

Serializes &self to a Vec<u8>.

Returns the length of the Vec<u8> which would be returned from a successful call to to_bytes() or into_bytes(). The data is not actually serialized, so this call is relatively cheap.

Provided methods

Consumes self and serializes to a Vec<u8>.

Implementations on Foreign Types

Implementors