Struct libafl::observers::map::StdMapObserver[][src]

pub struct StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned
{ /* fields omitted */ }
Expand description

The Map Observer retrieves the state of a map, that will get updated by the target. A well-known example is the AFL-Style coverage map.

Implementations

impl<'a, T> StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned
[src]

#[must_use]
pub fn new(name: &'static str, map: &'a mut [T]) -> Self
[src]

Creates a new MapObserver

#[must_use]
pub fn new_owned(name: &'static str, map: Vec<T>) -> Self
[src]

Creates a new MapObserver with an owned map

pub unsafe fn new_from_ptr(
    name: &'static str,
    map_ptr: *mut T,
    len: usize
) -> Self
[src]

Creates a new MapObserver from a raw pointer

Safety

Will dereference the map_ptr with up to len elements.

Trait Implementations

impl<'a, T: Debug> Debug for StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned
[src]

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

Formats the value using the given formatter. Read more

impl<'de, 'a, T> Deserialize<'de> for StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned,
    T: DeserializeOwned
[src]

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

Deserialize this value from the given Serde deserializer. Read more

impl<'a, EM, I, S, T, Z> HasExecHooks<EM, I, S, Z> for StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned,
    Self: MapObserver<T>, 
[src]

fn pre_exec(
    &mut self,
    _fuzzer: &mut Z,
    _state: &mut S,
    _mgr: &mut EM,
    _input: &I
) -> Result<(), Error>
[src]

Called right before exexution starts

fn post_exec(
    &mut self,
    _fuzzer: &mut Z,
    _state: &mut S,
    _mgr: &mut EM,
    _input: &I
) -> Result<(), Error>
[src]

Called right after execution finished.

impl<'a, T> MapObserver<T> for StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned
[src]

fn map(&self) -> &[T][src]

Get the map

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

Get the map (mutable)

fn initial(&self) -> T[src]

Get the initial value for reset()

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

Get the initial value for reset()

fn set_initial(&mut self, initial: T)[src]

Set the initial value for reset()

fn usable_count(&self) -> usize[src]

Get the number of usable entries in the map (all by default)

fn reset_map(&mut self) -> Result<(), Error>[src]

Reset the map

impl<'a, T> Named for StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned
[src]

fn name(&self) -> &str[src]

Provide the name of this element.

impl<'a, T> Observer for StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned
[src]

fn flush(&mut self) -> Result<(), Error>[src]

The testcase finished execution, calculate any changes. Reserved for future use. Read more

impl<'a, T> Serialize for StdMapObserver<'a, T> where
    T: Default + Copy + 'static + Serialize + DeserializeOwned,
    T: DeserializeOwned
[src]

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for StdMapObserver<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for StdMapObserver<'a, T> where
    T: Send

impl<'a, T> Sync for StdMapObserver<'a, T> where
    T: Sync

impl<'a, T> Unpin for StdMapObserver<'a, T> where
    T: Unpin

impl<'a, T> !UnwindSafe for StdMapObserver<'a, T>

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<Tail, T> Prepend<T> for Tail[src]

type PreprendResult = Tail

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

pub fn prepend(Self, T) -> (T, <Tail as Prepend<T>>::PreprendResult)[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

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.

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