ByteArray

Trait ByteArray 

Source
pub trait ByteArray: Clone {
    // Required methods
    fn len() -> usize;
    fn as_bytes_slice(&self) -> &[u8] ;
    fn as_mut_bytes_slice(&mut self) -> &mut [u8] ;
    fn rotate_right(&mut self, bytes: usize);
    fn new(value: u8) -> Self;
}
Expand description

Helper that allows us to cast a fixed size array into a byte slice.

Required Methods§

Source

fn len() -> usize

Source

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

Source

fn as_mut_bytes_slice(&mut self) -> &mut [u8]

Source

fn rotate_right(&mut self, bytes: usize)

Source

fn new(value: u8) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<const N: usize> ByteArray for [u8; N]

Source§

fn len() -> usize

Source§

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

Source§

fn as_mut_bytes_slice(&mut self) -> &mut [u8]

Source§

fn rotate_right(&mut self, bytes: usize)

Source§

fn new(value: u8) -> Self

Implementors§