Skip to main content

ToBytes

Trait ToBytes 

Source
pub trait ToBytes {
    type Bytes: IntoIterator<Item = u8>;

    // Required method
    fn to_bytes(&self) -> Self::Bytes;
}
Expand description

Operation types that may be converted to their serialized form in bytes.

Required Associated Types§

Source

type Bytes: IntoIterator<Item = u8>

The iterator yielding bytes.

Required Methods§

Source

fn to_bytes(&self) -> Self::Bytes

Convert the operation to its serialized form in bytes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§