Struct libafl::bolts::llmp::LlmpSharedMap [−][src]
pub struct LlmpSharedMap<SHM> where
SHM: ShMem, {
pub shmem: SHM,
}
A page wrapper
Fields
shmem: SHM
Shmem containg the actual (unsafe) page, shared between one LlmpSender and one LlmpReceiver
Implementations
impl<SHM> LlmpSharedMap<SHM> where
SHM: ShMem,
[src]
impl<SHM> LlmpSharedMap<SHM> where
SHM: ShMem,
[src]The page struct, placed on a shared mem instance.
A thin wrapper around a ShMem
implementation, with special crate::bolts::llmp
funcs
pub fn new(sender: ClientId, new_map: SHM) -> Self
[src]
pub fn new(sender: ClientId, new_map: SHM) -> Self
[src]Creates a new page, initializing the passed shared mem struct
pub fn mark_save_to_unmap(&mut self)
[src]
pub fn mark_save_to_unmap(&mut self)
[src]Marks the containing page as save_to_unmap
.
This indicates, that the page may safely be unmapped by the sender.
pub unsafe fn page_mut(&mut self) -> *mut LlmpPage
[src]
pub unsafe fn page_mut(&mut self) -> *mut LlmpPage
[src]Get the unsafe ptr to this page, situated on the shared map
Safety
The unsafe page pointer is obviously unsafe.
pub unsafe fn page(&self) -> *const LlmpPage
[src]
pub unsafe fn page(&self) -> *const LlmpPage
[src]Get the unsafe ptr to this page, situated on the shared map
Safety
The unsafe page pointer is obviously unsafe.
pub unsafe fn msg_to_offset(&self, msg: *const LlmpMsg) -> Result<u64, Error>
[src]
pub unsafe fn msg_to_offset(&self, msg: *const LlmpMsg) -> Result<u64, Error>
[src]Gets the offset of a message on this here page.
Will return crate::Error::IllegalArgument
error if msg is not on page.
Safety
This dereferences msg, make sure to pass a proper pointer to it.
pub fn msg_from_env(
&mut self,
map_env_name: &str
) -> Result<*mut LlmpMsg, Error>
[src]
pub fn msg_from_env(
&mut self,
map_env_name: &str
) -> Result<*mut LlmpMsg, Error>
[src]Retrieve the stored msg from env_name
+ _OFFSET
.
It will restore the stored offset by env_name
and return the message.
pub unsafe fn msg_to_env(
&self,
msg: *const LlmpMsg,
map_env_name: &str
) -> Result<(), Error>
[src]
pub unsafe fn msg_to_env(
&self,
msg: *const LlmpMsg,
map_env_name: &str
) -> Result<(), Error>
[src]Store this msg offset to env_name
+ _OFFSET
env variable.
It can be restored using LlmpSharedMap::msg_from_env()
with the same env_name
later.
Safety
This function will dereference the msg ptr, make sure it’s valid.
pub fn msg_from_offset(&mut self, offset: u64) -> Result<*mut LlmpMsg, Error>
[src]
pub fn msg_from_offset(&mut self, offset: u64) -> Result<*mut LlmpMsg, Error>
[src]Gets this message from this page, at the indicated offset.
Will return crate::Error::IllegalArgument
error if the offset is out of bounds.
Trait Implementations
impl<SHM: Clone> Clone for LlmpSharedMap<SHM> where
SHM: ShMem,
[src]
impl<SHM: Clone> Clone for LlmpSharedMap<SHM> where
SHM: ShMem,
[src]fn clone(&self) -> LlmpSharedMap<SHM>
[src]
fn clone(&self) -> LlmpSharedMap<SHM>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<SHM> RefUnwindSafe for LlmpSharedMap<SHM> where
SHM: RefUnwindSafe,
SHM: RefUnwindSafe,
impl<SHM> Send for LlmpSharedMap<SHM> where
SHM: Send,
SHM: Send,
impl<SHM> Sync for LlmpSharedMap<SHM> where
SHM: Sync,
SHM: Sync,
impl<SHM> Unpin for LlmpSharedMap<SHM> where
SHM: Unpin,
SHM: Unpin,
impl<SHM> UnwindSafe for LlmpSharedMap<SHM> where
SHM: UnwindSafe,
SHM: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more