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§

source

fn id(&self) -> ShMemId

Get the id of this shared memory mapping

source

fn len(&self) -> usize

Get the size of this mapping

Provided Methods§

source

fn is_empty(&self) -> bool

Check if the mapping is empty

source

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

source

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

source

fn description(&self) -> ShMemDescription

Get the description of the shared memory mapping

source

fn write_to_env(&self, env_name: &str) -> Result<(), Error>

Write this map’s config to env

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ShMem for AshmemShMem

source§

impl ShMem for MmapShMem

source§

impl<SH> ShMem for ServedShMem<SH>
where SH: ShMem,

source§

impl<T> ShMem for RcShMem<T>
where T: ShMemProvider + Debug,