Trait rgb::ByteSlice [] [src]

pub trait ByteSlice {
    fn as_bytes(&self) -> &[u8];
    fn as_bytes_mut(&mut self) -> &mut [u8];
}

Cast array of structs into array of raw bytes (so that [0] is R, [1] is G, [2] is B, etc.)

Escape hatch for interoperability with C and non-type-safe libraries.

Required Methods

Read-only view of bytes. [0] is R, [1] is G, [2] is B, etc.

Read-write view of bytes.

Implementors