logo
pub unsafe trait BufferContents: Send + Sync + 'static {
    fn as_bytes(&self) -> &[u8]Notable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8];
fn from_bytes(bytes: &[u8]) -> Result<&Self, PodCastError>;
fn from_bytes_mut(bytes: &mut [u8]) -> Result<&mut Self, PodCastError>;
fn size_of_element() -> DeviceSize; }
Expand description

Trait for types of data that can be put in a buffer. These can be safely transmuted to and from a slice of bytes.

Required methods

Converts an immutable reference to Self to an immutable byte slice.

Converts an immutable byte slice into an immutable reference to Self.

Converts a mutable byte slice into a mutable reference to Self.

Returns the size of an element of the type.

Implementations on Foreign Types

Implementors