Trait inspect_format::ReadBytes

source ·
pub trait ReadBytes: BlockContainer {
    // Required method
    fn get_slice_at(&self, offset: usize, size: usize) -> Option<&[u8]>;

    // Provided methods
    fn get_slice(&self, size: usize) -> Option<&[u8]> { ... }
    fn get_value<T: ContainerValue>(&self, offset: usize) -> Option<&T> { ... }
}
Expand description

Trait implemented by an Inspect container that can be read from.

Required Methods§

source

fn get_slice_at(&self, offset: usize, size: usize) -> Option<&[u8]>

Returns a slice of the given size at the given offset if one exists of the exact size.

Provided Methods§

source

fn get_slice(&self, size: usize) -> Option<&[u8]>

Returns a slice of the given size at the beginning of the container if one exists of the exact size.

source

fn get_value<T: ContainerValue>(&self, offset: usize) -> Option<&T>

Returns a reference to the value at the give offset, if one exists.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ReadBytes for Vec<u8>

source§

fn get_slice_at(&self, offset: usize, size: usize) -> Option<&[u8]>

source§

impl ReadBytes for [u8]

source§

fn get_slice_at(&self, offset: usize, size: usize) -> Option<&[u8]>

source§

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

source§

fn get_slice_at(&self, offset: usize, size: usize) -> Option<&[u8]>

Implementors§