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§
Provided Methods§
Sourcefn get_slice(&self, size: usize) -> Option<&[u8]>
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.
Sourcefn get_value<T: ContainerValue>(&self, offset: usize) -> Option<T>
fn get_value<T: ContainerValue>(&self, offset: usize) -> Option<T>
Returns the value at the given offset, if one exists.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".