EntryBuilder

Struct EntryBuilder 

Source
pub struct EntryBuilder<'a, K, T, IK>
where IK: Iterator<Item = K> + 'a, K: Ord,
{ /* private fields */ }
Expand description

EntryBuilder for the entry method. Entries are lazily evaluated, thus the builder is used to provide the configuration, while the entry is already evaluated.

Implementations§

Source§

impl<'a, K, T, IK> EntryBuilder<'a, K, T, IK>
where IK: Iterator<Item = K> + 'a, K: Ord,

Source

pub fn and_extend(self, default: impl IntoIterator<Item = T>) -> Entry<'a, K, T>

Extends the entry, creating it if needed

Source

pub fn and_insert(self, default: T) -> Entry<'a, K, T>

Inserts into the entry, creating it if needed

Source

pub fn or_extend(self, default: impl IntoIterator<Item = T>) -> Entry<'a, K, T>

Finds the entry, and if it does not exist, extends with the provided value.

Source

pub fn or_insert(self, default: T) -> Entry<'a, K, T>

Finds the entry, and if it does not exist, inserts the value.

Source

pub fn or_create(self) -> Entry<'a, K, T>

Finds the entry, and if it does not exist, creates it.

Source

pub fn find(self) -> Option<ExistingEntry<'a, K, T>>

Finds the entry, but does not create one. This method short circuits on the first missing key.

Source

pub fn items(self) -> Option<&'a Vec<T>>

Returns all associated items of an entry.

Source

pub fn items_mut(self) -> Option<&'a mut Vec<T>>

Mutably returns all associated items of an entry.

Auto Trait Implementations§

§

impl<'a, K, T, IK> Freeze for EntryBuilder<'a, K, T, IK>
where IK: Freeze,

§

impl<'a, K, T, IK> RefUnwindSafe for EntryBuilder<'a, K, T, IK>

§

impl<'a, K, T, IK> Send for EntryBuilder<'a, K, T, IK>
where IK: Send, T: Send, K: Send,

§

impl<'a, K, T, IK> Sync for EntryBuilder<'a, K, T, IK>
where IK: Sync, T: Sync, K: Sync,

§

impl<'a, K, T, IK> Unpin for EntryBuilder<'a, K, T, IK>
where IK: Unpin,

§

impl<'a, K, T, IK> !UnwindSafe for EntryBuilder<'a, K, T, IK>

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.