Trait inspect_format::WriteBytes
source · pub trait WriteBytes {
// Required method
fn get_slice_mut_at(
&mut self,
offset: usize,
size: usize,
) -> Option<&mut [u8]>;
// Provided methods
fn get_slice_mut(&mut self, size: usize) -> Option<&mut [u8]> { ... }
fn copy_from_slice_at(&mut self, offset: usize, bytes: &[u8]) { ... }
fn copy_from_slice(&mut self, bytes: &[u8]) { ... }
fn get_value_mut<T: ContainerValue>(
&mut self,
offset: usize,
) -> Option<&mut T> { ... }
fn set_value<T: ContainerValue>(&mut self, offset: usize, value: T) { ... }
}
Expand description
Trait implemented by container to which bytes can be written.
Required Methods§
Provided Methods§
sourcefn get_slice_mut(&mut self, size: usize) -> Option<&mut [u8]>
fn get_slice_mut(&mut self, size: usize) -> Option<&mut [u8]>
Returns an exclusive reference to a slice of the given size at the beginning of the container if one exists of the exact size.
fn copy_from_slice_at(&mut self, offset: usize, bytes: &[u8])
fn copy_from_slice(&mut self, bytes: &[u8])
sourcefn get_value_mut<T: ContainerValue>(&mut self, offset: usize) -> Option<&mut T>
fn get_value_mut<T: ContainerValue>(&mut self, offset: usize) -> Option<&mut T>
Returns an exclusive reference to the value at the give offset, if one exists.
fn set_value<T: ContainerValue>(&mut self, offset: usize, value: T)
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<const N: usize> WriteBytes for [u8; N]
impl<const N: usize> WriteBytes for [u8; N]
Trait implemented by an Inspect container that can be written to.