Struct libafl_bolts::shmem::ShMemId

source ·
pub struct ShMemId { /* private fields */ }
Expand description

An id associated with a given shared memory mapping (ShMem), which can be used to establish shared-mappings between proccesses. Id is a file descriptor if you use MmapShMem or AshmemShMem. That means you have to use shmem server to access to the shmem segment from other processes in these cases. On the other hand, id is a unique identifier if you use CommonUnixShMem or Win32ShMem. In these two cases, you can use shmat(id) or OpenFileMappingA(id) to gain access to the shmem

Implementations§

source§

impl ShMemId

source

pub fn from_array(array: &[u8; 20]) -> Self

Create a new id from a fixed-size string/bytes array It should contain a valid cstring.

source

pub fn try_from_slice(slice: &[u8]) -> Result<Self, Error>

Try to create a new id from a bytes string. The slice must have a length of at least 20 bytes and contain a valid cstring.

source

pub fn from_int(val: i32) -> Self

Create a new id from an int

source

pub fn from_string(val: &str) -> Self

Create a new id from a string

source

pub const fn is_empty(&self) -> bool

Returns true if this ShMemId has an empty backing slice. If this is the case something went wrong, and this ShMemId may not be read from.

source

pub const fn as_array(&self) -> &[u8; 20]

Get the id as a fixed-length slice

source

pub fn null_pos(&self) -> usize

Returns the first null-byte in or the end of the buffer

source

pub fn as_str(&self) -> &str

Returns a str representation of this ShMemId

Trait Implementations§

source§

impl AsSlice for ShMemId

§

type Entry = u8

Type of the entries in this slice
source§

fn as_slice(&self) -> &[u8]

Convert to a slice
source§

impl Clone for ShMemId

source§

fn clone(&self) -> ShMemId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ShMemId

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for ShMemId

source§

fn default() -> ShMemId

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ShMemId

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for ShMemId

source§

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

Formats the value using the given formatter. Read more
source§

impl From<ShMemId> for i32

source§

fn from(id: ShMemId) -> i32

Converts to this type from the input type.
source§

impl Hash for ShMemId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ShMemId

source§

fn eq(&self, other: &ShMemId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ShMemId

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for ShMemId

source§

impl Eq for ShMemId

source§

impl StructuralPartialEq for ShMemId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

The Resulting TupleList, of an Prepend::prepend() call, including the prepended entry.
source§

fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)

Prepend a value to this tuple, returning a new tuple with prepended value.
source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Ungil for T
where T: Send,