encase::internal

Trait BufferRef

Source
pub trait BufferRef {
    // Required methods
    fn len(&self) -> usize;
    fn read<const N: usize>(&self, offset: usize) -> &[u8; N];
    fn read_slice(&self, offset: usize, val: &mut [u8]);
}

Required Methods§

Source

fn len(&self) -> usize

Source

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source

fn read_slice(&self, offset: usize, val: &mut [u8])

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 BufferRef for Vec<u8>

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Source§

impl BufferRef for [u8]

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Source§

impl<T: ?Sized + BufferRef> BufferRef for &T

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Source§

impl<T: ?Sized + BufferRef> BufferRef for &mut T

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Source§

impl<T: ?Sized + BufferRef> BufferRef for Box<T>

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Source§

impl<T: ?Sized + BufferRef> BufferRef for Rc<T>

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Source§

impl<T: ?Sized + BufferRef> BufferRef for Arc<T>

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Source§

impl<const LEN: usize> BufferRef for [u8; LEN]

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Implementors§