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]

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]

Creates a new page, initializing the passed shared mem struct

pub fn existing(existing_map: SHM) -> Self[src]

Maps and wraps an existing

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]

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]

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]

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]

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]

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]

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]

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]

Performs copy-assignment from source. Read more

impl<SHM: Debug> Debug for LlmpSharedMap<SHM> where
    SHM: ShMem
[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<SHM> RefUnwindSafe for LlmpSharedMap<SHM> where
    SHM: RefUnwindSafe

impl<SHM> Send for LlmpSharedMap<SHM> where
    SHM: Send

impl<SHM> Sync for LlmpSharedMap<SHM> where
    SHM: Sync

impl<SHM> Unpin for LlmpSharedMap<SHM> where
    SHM: Unpin

impl<SHM> UnwindSafe for LlmpSharedMap<SHM> where
    SHM: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.