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