AsBytes

Trait AsBytes 

Source
pub trait AsBytes {
    // Required method
    fn as_bytes(&self) -> &[u8] ;
}
Expand description

Types that can be represented as a u8 slice.

§Safety

This trait should only be implemented if the type can be safely converted to a slice.

Required Methods§

Source

fn as_bytes(&self) -> &[u8]

Return a byte slice representation.

Implementations on Foreign Types§

Source§

impl AsBytes for ()

Source§

fn as_bytes(&self) -> &[u8]

Source§

impl<T> AsBytes for &[T]

Source§

fn as_bytes(&self) -> &[u8]

Implementors§

Source§

impl AsBytes for Empty

Source§

impl<T> AsBytes for T
where T: Packed,