Struct Values

Source
pub struct Values<T, S = RandomState>(/* private fields */);
Expand description

A bag of values for a given key in the evmap.

Implementations§

Source§

impl<T, S> Values<T, S>

Source

pub fn len(&self) -> usize

Returns the number of values.

Source

pub fn is_empty(&self) -> bool

Returns true if the bag holds no values.

Source

pub fn capacity(&self) -> usize

Returns the number of values that can be held without reallocating.

Source

pub fn iter(&self) -> ValuesIter<'_, T, S>

An iterator visiting all elements in arbitrary order.

The iterator element type is &’a T.

Source

pub fn get_one(&self) -> Option<&T>

Returns a guarded reference to one value corresponding to the key.

This is mostly intended for use when you are working with no more than one value per key. If there are multiple values stored for this key, there are no guarantees to which element is returned.

Source

pub fn contains<Q>(&self, value: &Q) -> bool
where T: Borrow<Q> + Eq + Hash, Q: Eq + Hash + ?Sized, S: BuildHasher,

Returns true if a value matching value is among the stored values.

The value may be any borrowed form of T, but Hash and Eq on the borrowed form must match those for the value type.

Trait Implementations§

Source§

impl<T, S> Debug for Values<T, S>
where T: Debug, S: BuildHasher,

Source§

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

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

impl<T, S> Default for Values<T, S>

Source§

fn default() -> Self

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

impl<'a, T, S> IntoIterator for &'a Values<T, S>

Source§

type IntoIter = ValuesIter<'a, T, S>

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

type Item = &'a T

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T, S> Freeze for Values<T, S>
where S: Freeze, T: Freeze,

§

impl<T, S> RefUnwindSafe for Values<T, S>

§

impl<T, S> Send for Values<T, S>
where T: Send, S: Send,

§

impl<T, S> Sync for Values<T, S>
where T: Sync, S: Sync,

§

impl<T, S> Unpin for Values<T, S>
where S: Unpin, T: Unpin,

§

impl<T, S> UnwindSafe for Values<T, S>

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.