Struct libafl::observers::map::ConstMapObserver
source · pub struct ConstMapObserver<'a, T, const N: usize>where
T: Default + Copy + 'static + Serialize,{ /* private fields */ }
Expand description
Use a const size to speedup Feedback::is_interesting
when the user can
know the size of the map at compile time.
Implementations§
source§impl<'a, T, const N: usize> ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
impl<'a, T, const N: usize> ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
sourcepub fn new(name: &'static str, map: &'a mut [T]) -> Self
pub fn new(name: &'static str, map: &'a mut [T]) -> Self
Creates a new MapObserver
Note
Will get a pointer to the map and dereference it at any point in time. The map must not move in memory!
sourcepub fn new_owned(name: &'static str, map: Vec<T>) -> Self
pub fn new_owned(name: &'static str, map: Vec<T>) -> Self
Creates a new MapObserver
with an owned map
sourcepub unsafe fn from_mut_ptr(name: &'static str, map_ptr: *mut T) -> Self
pub unsafe fn from_mut_ptr(name: &'static str, map_ptr: *mut T) -> Self
Creates a new MapObserver
from a raw pointer
Safety
Will dereference the map_ptr
with up to len elements.
Trait Implementations§
source§impl<'a, 'it, T, const N: usize> AsIter<'it> for ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
impl<'a, 'it, T, const N: usize> AsIter<'it> for ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
source§impl<'a, 'it, T, const N: usize> AsIterMut<'it> for ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
impl<'a, 'it, T, const N: usize> AsIterMut<'it> for ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
source§impl<'a, T, const N: usize> AsMutSlice for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
impl<'a, T, const N: usize> AsMutSlice for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
source§impl<'a, T, const N: usize> AsSlice for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
impl<'a, T, const N: usize> AsSlice for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
source§impl<'a, T, const N: usize> Debug for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + Debug,
impl<'a, T, const N: usize> Debug for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + Debug,
source§impl<'de, 'a, T, const N: usize> Deserialize<'de> for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
impl<'de, 'a, T, const N: usize> Deserialize<'de> for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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<'a, T, const N: usize> HasLen for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
impl<'a, T, const N: usize> HasLen for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
source§impl<'a, 'it, T, const N: usize> IntoIterator for &'it ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
impl<'a, 'it, T, const N: usize> IntoIterator for &'it ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
source§impl<'a, 'it, T, const N: usize> IntoIterator for &'it mut ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
impl<'a, 'it, T, const N: usize> IntoIterator for &'it mut ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
source§impl<'a, T, const N: usize> MapObserver for ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
impl<'a, T, const N: usize> MapObserver for ConstMapObserver<'a, T, N>where
T: Bounded + PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
source§fn count_bytes(&self) -> u64
fn count_bytes(&self) -> u64
Count the set bytes in the map
source§fn how_many_set(&self, indexes: &[usize]) -> usize
fn how_many_set(&self, indexes: &[usize]) -> usize
Get the number of set entries with the specified indexes
source§fn usable_count(&self) -> usize
fn usable_count(&self) -> usize
Get the number of usable entries in the map (all by default)
source§impl<'a, T, const N: usize> Named for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
impl<'a, T, const N: usize> Named for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
source§impl<'a, S, T, const N: usize> Observer<S> for ConstMapObserver<'a, T, N>where
S: UsesInput,
T: Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
Self: MapObserver,
impl<'a, S, T, const N: usize> Observer<S> for ConstMapObserver<'a, T, N>where
S: UsesInput,
T: Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
Self: MapObserver,
source§fn pre_exec(&mut self, _state: &mut S, _input: &S::Input) -> Result<(), Error>
fn pre_exec(&mut self, _state: &mut S, _input: &S::Input) -> Result<(), Error>
Called right before execution starts.
source§fn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
The testcase finished execution, calculate any changes.
Reserved for future use.
source§fn post_exec(
&mut self,
_state: &mut S,
_input: &S::Input,
_exit_kind: &ExitKind
) -> Result<(), Error>
fn post_exec(
&mut self,
_state: &mut S,
_input: &S::Input,
_exit_kind: &ExitKind
) -> Result<(), Error>
Called right after execution finishes.
source§fn pre_exec_child(
&mut self,
_state: &mut S,
_input: &S::Input
) -> Result<(), Error>
fn pre_exec_child(
&mut self,
_state: &mut S,
_input: &S::Input
) -> Result<(), Error>
Called right before execution starts in the child process, if any.
source§fn post_exec_child(
&mut self,
_state: &mut S,
_input: &S::Input,
_exit_kind: &ExitKind
) -> Result<(), Error>
fn post_exec_child(
&mut self,
_state: &mut S,
_input: &S::Input,
_exit_kind: &ExitKind
) -> Result<(), Error>
Called right after execution finishes in the child process, if any.
source§fn observes_stdout(&self) -> bool
fn observes_stdout(&self) -> bool
If this observer observes
stdout
source§fn observes_stderr(&self) -> bool
fn observes_stderr(&self) -> bool
If this observer observes
stderr
source§fn observe_stdout(&mut self, stdout: &[u8])
fn observe_stdout(&mut self, stdout: &[u8])
React to new
stdout
To use this, always return true
from observes_stdout
source§fn observe_stderr(&mut self, stderr: &[u8])
fn observe_stderr(&mut self, stderr: &[u8])
React to new
stderr
To use this, always return true
from observes_stderr
source§impl<'a, T, const N: usize> Serialize for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
impl<'a, T, const N: usize> Serialize for ConstMapObserver<'a, T, N>where
T: Default + Copy + 'static + Serialize + DeserializeOwned,
Auto Trait Implementations§
impl<'a, T, const N: usize> RefUnwindSafe for ConstMapObserver<'a, T, N>where
T: RefUnwindSafe,
impl<'a, T, const N: usize> !Send for ConstMapObserver<'a, T, N>
impl<'a, T, const N: usize> !Sync for ConstMapObserver<'a, T, N>
impl<'a, T, const N: usize> Unpin for ConstMapObserver<'a, T, N>where
T: Unpin,
impl<'a, T, const N: usize> !UnwindSafe for ConstMapObserver<'a, T, N>
Blanket Implementations§
source§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = 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)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
Prepend a value to this tuple, returning a new tuple with prepended value.