Struct libafl_bolts::serdeany::serdeany_registry::NamedSerdeAnyMap
source · pub struct NamedSerdeAnyMap { /* private fields */ }
Expand description
A serializable HashMap
wrapper for crate::serdeany::SerdeAny
types, addressable by name.
Implementations§
source§impl NamedSerdeAnyMap
impl NamedSerdeAnyMap
sourcepub fn remove<T>(&mut self, name: &str) -> Option<Box<T>>where
T: SerdeAny,
pub fn remove<T>(&mut self, name: &str) -> Option<Box<T>>where
T: SerdeAny,
Remove an element by type and name
sourcepub fn get_mut<T>(&mut self, name: &str) -> Option<&mut T>where
T: SerdeAny,
pub fn get_mut<T>(&mut self, name: &str) -> Option<&mut T>where
T: SerdeAny,
Get an element of a given type contained in this map by type T
, as mut.
sourcepub fn get_all<T>(
&self
) -> Option<Map<Values<'_, String, Box<dyn SerdeAny>>, fn(_: &Box<dyn SerdeAny>) -> &T>>where
T: SerdeAny,
pub fn get_all<T>(
&self
) -> Option<Map<Values<'_, String, Box<dyn SerdeAny>>, fn(_: &Box<dyn SerdeAny>) -> &T>>where
T: SerdeAny,
Get all elements of a type contained in this map.
sourcepub fn get_all_mut<T>(
&mut self
) -> Option<Map<ValuesMut<'_, String, Box<dyn SerdeAny>>, fn(_: &mut Box<dyn SerdeAny>) -> &mut T>>where
T: SerdeAny,
pub fn get_all_mut<T>(
&mut self
) -> Option<Map<ValuesMut<'_, String, Box<dyn SerdeAny>>, fn(_: &mut Box<dyn SerdeAny>) -> &mut T>>where
T: SerdeAny,
Get all elements contained in this map, as mut.
sourcepub fn for_each<F: FnMut(&TypeRepr, &Box<dyn SerdeAny>) -> Result<(), Error>>(
&self,
func: &mut F
) -> Result<(), Error>
pub fn for_each<F: FnMut(&TypeRepr, &Box<dyn SerdeAny>) -> Result<(), Error>>( &self, func: &mut F ) -> Result<(), Error>
Run func
for each element in this map.
sourcepub fn for_each_mut<F: FnMut(&TypeRepr, &mut Box<dyn SerdeAny>) -> Result<(), Error>>(
&mut self,
func: &mut F
) -> Result<(), Error>
pub fn for_each_mut<F: FnMut(&TypeRepr, &mut Box<dyn SerdeAny>) -> Result<(), Error>>( &mut self, func: &mut F ) -> Result<(), Error>
Run func
for each element in this map, getting a mutable borrow.
sourcepub fn insert<T>(&mut self, name: &str, val: T)where
T: SerdeAny,
pub fn insert<T>(&mut self, name: &str, val: T)where
T: SerdeAny,
Insert an element into this map.
sourcepub fn get_or_insert_with<T>(
&mut self,
name: &str,
default: impl FnOnce() -> T
) -> &mut Twhere
T: SerdeAny,
pub fn get_or_insert_with<T>(
&mut self,
name: &str,
default: impl FnOnce() -> T
) -> &mut Twhere
T: SerdeAny,
Gets a value by name, or inserts it using the given construction function default
sourcepub fn get_or_insert_with_boxed<T>(
&mut self,
name: &str,
default: impl FnOnce() -> Box<T>
) -> &mut Twhere
T: SerdeAny + 'static,
pub fn get_or_insert_with_boxed<T>(
&mut self,
name: &str,
default: impl FnOnce() -> Box<T>
) -> &mut Twhere
T: SerdeAny + 'static,
Gets a value by name, or inserts it using the given construction function default
(returning a boxed value)
sourcepub fn contains_type<T>(&self) -> boolwhere
T: SerdeAny,
pub fn contains_type<T>(&self) -> boolwhere
T: SerdeAny,
Returns if the element with a given type is contained in this map.
Trait Implementations§
source§impl Clone for NamedSerdeAnyMap
impl Clone for NamedSerdeAnyMap
source§impl Debug for NamedSerdeAnyMap
impl Debug for NamedSerdeAnyMap
source§impl Default for NamedSerdeAnyMap
impl Default for NamedSerdeAnyMap
source§impl<'de> Deserialize<'de> for NamedSerdeAnyMap
impl<'de> Deserialize<'de> for NamedSerdeAnyMap
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
Auto Trait Implementations§
impl Freeze for NamedSerdeAnyMap
impl !RefUnwindSafe for NamedSerdeAnyMap
impl !Send for NamedSerdeAnyMap
impl !Sync for NamedSerdeAnyMap
impl Unpin for NamedSerdeAnyMap
impl !UnwindSafe for NamedSerdeAnyMap
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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.