Struct libafl::bolts::serdeany::serdeany_registry::NamedSerdeAnyMap[][src]

pub struct NamedSerdeAnyMap { /* fields omitted */ }

A serializable HashMap wrapper for SerdeAny types, addressable by name.

Implementations

impl NamedSerdeAnyMap[src]

#[must_use]
pub fn get<T>(&self, name: &str) -> Option<&T> where
    T: Any
[src]

Get an element by name

#[must_use]
pub fn by_typeid(&self, name: &str, typeid: &TypeId) -> Option<&dyn SerdeAny>
[src]

Get an element of a given type contained in this map by TypeId.

#[must_use]
pub fn get_mut<T>(&mut self, name: &str) -> Option<&mut T> where
    T: Any
[src]

Get an element of a given type contained in this map by TypeId, as mut.

#[must_use]
pub fn by_typeid_mut(
    &mut self,
    name: &str,
    typeid: &TypeId
) -> Option<&mut dyn SerdeAny>
[src]

Get an element of a given type contained in this map by TypeId, as mut.

#[must_use]
pub fn get_all<T>(
    &self
) -> Option<Map<Values<'_, u64, Box<dyn SerdeAny>>, fn(_: &Box<dyn SerdeAny>) -> &T>> where
    T: Any
[src]

Get all elements of a type contained in this map.

#[must_use]
pub fn all_by_typeid(
    &self,
    typeid: &TypeId
) -> Option<Map<Values<'_, u64, Box<dyn SerdeAny>>, fn(_: &Box<dyn SerdeAny>) -> &dyn SerdeAny>>
[src]

Get all elements of a given type contained in this map by TypeId.

pub fn get_all_mut<T>(
    &mut self
) -> Option<Map<ValuesMut<'_, u64, Box<dyn SerdeAny>>, fn(_: &mut Box<dyn SerdeAny>) -> &mut T>> where
    T: Any
[src]

Get all elements contained in this map, as mut.

pub fn all_by_typeid_mut(
    &mut self,
    typeid: &TypeId
) -> Option<Map<ValuesMut<'_, u64, Box<dyn SerdeAny>>, fn(_: &mut Box<dyn SerdeAny>) -> &mut dyn SerdeAny>>
[src]

Get all TypeIds contained in this map, as mut.

pub fn all_typeids(
    &self
) -> Map<Keys<'_, u64, HashMap<u64, Box<dyn SerdeAny>>>, fn(_: &u64) -> TypeId>
[src]

Get all TypeIds contained in this map.

pub fn for_each(
    &self,
    func: fn(_: &TypeId, _: &Box<dyn SerdeAny>) -> Result<(), Error>
) -> Result<(), Error>
[src]

Run func for each element in this map.

pub fn for_each_mut(
    &mut self,
    func: fn(_: &TypeId, _: &mut Box<dyn SerdeAny>) -> Result<(), Error>
) -> Result<(), Error>
[src]

Run func for each element in this map, getting a mutable borrow.

pub fn insert(&mut self, val: Box<dyn SerdeAny>, name: &str)[src]

Insert an element into this map.

#[must_use]
pub fn len(&self) -> usize
[src]

Returns the len of this map.

#[must_use]
pub fn contains_type<T>(&self) -> bool where
    T: Any
[src]

Returns if the element with a given type is contained in this map.

#[must_use]
pub fn contains<T>(&self, name: &str) -> bool where
    T: Any
[src]

Returns if the element by a given name is contained in this map.

#[must_use]
pub fn new() -> Self
[src]

Create a new SerdeAny map.

Trait Implementations

impl Default for NamedSerdeAnyMap[src]

fn default() -> Self[src]

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

impl<'de> Deserialize<'de> for NamedSerdeAnyMap[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 Serialize for NamedSerdeAnyMap[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

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<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]