pub trait MapObserver: HasLen + Named + Serialize + DeserializeOwned + Debug {
    type Entry: Bounded + PartialEq + Default + Copy + Debug + 'static;

    fn get(&self, idx: usize) -> &Self::Entry;
    fn get_mut(&mut self, idx: usize) -> &mut Self::Entry;
    fn usable_count(&self) -> usize;
    fn count_bytes(&self) -> u64;
    fn hash(&self) -> u64;
    fn initial(&self) -> Self::Entry;
    fn initial_mut(&mut self) -> &mut Self::Entry;
    fn reset_map(&mut self) -> Result<(), Error>;
    fn to_vec(&self) -> Vec<Self::Entry>Notable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
    A: Allocator,
; fn how_many_set(&self, indexes: &[usize]) -> usize; fn set_initial(&mut self, initial: Self::Entry) { ... } }
Expand description

A MapObserver observes the static map, as oftentimes used for AFL-like coverage information

TODO: enforce iter() -> AssociatedTypeIter when generic associated types stabilize

Required Associated Types

Type of each entry in this map

Required Methods

Get the value at idx

Get the value at idx (mutable)

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

Count the set bytes in the map

Compute the hash of the map

Get the initial value for reset()

Get the initial value for reset() (mutable)

Reset the map

Get these observer’s contents as Vec

Get the number of set entries with the specified indexes

Provided Methods

Set the initial value for reset()

Implementors