embedded_graphics::pixelcolor::raw

Trait ToBytes

Source
pub trait ToBytes {
    type Bytes;

    // Required methods
    fn to_be_bytes(self) -> Self::Bytes;
    fn to_le_bytes(self) -> Self::Bytes;
    fn to_ne_bytes(self) -> Self::Bytes;
}
Expand description

Trait to convert colors into a byte array.

See the module-level documentation for an example.

Required Associated Types§

Source

type Bytes

Return type of methods in this trait.

Required Methods§

Source

fn to_be_bytes(self) -> Self::Bytes

Converts a color into a byte array with big endian byte order.

Source

fn to_le_bytes(self) -> Self::Bytes

Converts a color into a byte array with little endian byte order.

Source

fn to_ne_bytes(self) -> Self::Bytes

Converts a color into a byte array with native byte order.

Implementations on Foreign Types§

Source§

impl ToBytes for ()

Implementors§