Dfb

Struct Dfb 

Source
pub struct Dfb(/* private fields */);
Expand description

An “anymap” which uses TypeIDs as keys and VecDeques of that type as values.

Implementations§

Source§

impl Dfb

Source

pub fn new() -> Self

Creates a Dfb backed by HashMap::new

Source

pub fn with_capacity(capacity: usize) -> Self

Creates a Dfb backed by HashMap::with_capacity

Source

pub fn capacity(&self) -> usize

Wrapper for HashMap::capacity

Source

pub fn keys(&self) -> Keys<'_, TypeId, VecDeque<Box<dyn Any>>>

Wrapper for HashMap::keys

Source

pub fn values(&self) -> Values<'_, TypeId, VecDeque<Box<dyn Any>>>

Wrapper for HashMap::values

Source

pub fn values_mut(&mut self) -> ValuesMut<'_, TypeId, VecDeque<Box<dyn Any>>>

Wrapper for HashMap::values_mut

Source

pub fn iter(&self) -> Iter<'_, TypeId, VecDeque<Box<dyn Any>>>

Wrapper for HashMap::iter

Source

pub fn iter_mut(&mut self) -> IterMut<'_, TypeId, VecDeque<Box<dyn Any>>>

Wrapper for HashMap::iter_mut

Source

pub fn len(&self) -> usize

Wrapper for HashMap::len

Source

pub fn is_empty(&self) -> bool

Wrapper for HashMap::is_empty

Source

pub fn drain(&mut self) -> Drain<'_, TypeId, VecDeque<Box<dyn Any>>>

Wrapper for HashMap::drain

Source

pub fn clear(&mut self)

Wrapper for HashMap::clear

Source

pub fn reserve(&mut self, additional: usize)

Wrapper for HashMap::reserve

Source

pub fn shrink_to_fit(&mut self)

Source

pub fn entry<T: 'static>(&mut self) -> Entry<'_, TypeId, VecDeque<Box<dyn Any>>>

Generic wrapper for HashMap::entry

Source

pub fn contains<T: Any>(&self) -> bool

Generic wrapper for HashMap::get_key_value

Source

pub fn insert(&mut self, value: impl Any)

Generic wrapper for HashMap::insert. If one or more values of this type already exist in the map, this will push a new value into the FIFO that contains them. If no value exists, this will create a new FIFO containing the inserted element.

Source

pub fn insert_dyn(&mut self, value: Box<dyn Any>)

Like Dfb::insert, but allows boxed values of unknown type.

Source

pub fn remove<T: Any>(&mut self) -> Option<T>

Generic wrapper for HashMap::remove. Returns and removes the earliest inserted element of this type if it exists. If the element returned was the last remaining element of its type, the internal FIFO for this type is deleted.

Source

pub fn retain<F: FnMut(&TypeId, &mut VecDeque<Box<dyn Any>>) -> bool>( &mut self, f: F, )

Wrapper for HashMap::retain

Trait Implementations§

Source§

impl Debug for Dfb

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Dfb

Source§

fn default() -> Self

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

impl Extend<(TypeId, VecDeque<Box<dyn Any>>)> for Dfb

Source§

fn extend<T: IntoIterator<Item = (TypeId, VecDeque<Box<dyn Any>>)>>( &mut self, iter: T, )

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<const N: usize> From<[Box<dyn Any>; N]> for Dfb

Source§

fn from(items: [Box<dyn Any>; N]) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<(TypeId, VecDeque<Box<dyn Any>>)> for Dfb

Source§

fn from_iter<T: IntoIterator<Item = (TypeId, VecDeque<Box<dyn Any>>)>>( iter: T, ) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Box<dyn Any>> for Dfb

Source§

fn from_iter<T: IntoIterator<Item = Box<dyn Any>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl Index<TypeId> for Dfb

Source§

type Output = VecDeque<Box<dyn Any>>

The returned type after indexing.
Source§

fn index(&self, key: TypeId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a> IntoIterator for &'a Dfb

Source§

type Item = (&'a TypeId, &'a VecDeque<Box<dyn Any>>)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, TypeId, VecDeque<Box<dyn Any>>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a mut Dfb

Source§

type Item = (&'a TypeId, &'a mut VecDeque<Box<dyn Any>>)

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, TypeId, VecDeque<Box<dyn Any>>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl IntoIterator for Dfb

Source§

type Item = (TypeId, VecDeque<Box<dyn Any>>)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<TypeId, VecDeque<Box<dyn Any>>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl Send for Dfb

Source§

impl Sync for Dfb

Auto Trait Implementations§

§

impl Freeze for Dfb

§

impl !RefUnwindSafe for Dfb

§

impl Unpin for Dfb

§

impl !UnwindSafe for Dfb

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.