Trait libafl_bolts::shmem::ShMem
source · pub trait ShMem: Sized + Debug + Clone + AsSlice<Entry = u8> + AsMutSlice<Entry = u8> {
// Required methods
fn id(&self) -> ShMemId;
fn len(&self) -> usize;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn as_ptr_of<T: Sized>(&self) -> Option<*const T> { ... }
fn as_mut_ptr_of<T: Sized>(&mut self) -> Option<*mut T> { ... }
fn description(&self) -> ShMemDescription { ... }
fn write_to_env(&self, env_name: &str) -> Result<(), Error> { ... }
}
Expand description
A ShMem
is an interface to shared maps.
They are the backbone of crate::llmp
for inter-process communication.
All you need for scaling on a new target is to implement this interface, as well as the respective ShMemProvider
.
Required Methods§
Provided Methods§
sourcefn as_ptr_of<T: Sized>(&self) -> Option<*const T>
fn as_ptr_of<T: Sized>(&self) -> Option<*const T>
Convert to a ptr of a given type, checking the size.
If the map is too small, returns None
sourcefn as_mut_ptr_of<T: Sized>(&mut self) -> Option<*mut T>
fn as_mut_ptr_of<T: Sized>(&mut self) -> Option<*mut T>
Convert to a mut ptr of a given type, checking the size.
If the map is too small, returns None
sourcefn description(&self) -> ShMemDescription
fn description(&self) -> ShMemDescription
Get the description of the shared memory mapping
Object Safety§
This trait is not object safe.