Skip to main content

EventIdSet

Struct EventIdSet 

Source
pub struct EventIdSet<E>(/* private fields */)
where
    E: Borrow<EventId>;
Available on crate feature state-res only.
Expand description

A set of event IDs.

Implementations§

Source§

impl<E> EventIdSet<E>
where E: Borrow<EventId>,

Source

pub fn new() -> EventIdSet<E>

Create an empty EventIdSet.

Source

pub fn with_capacity(capacity: usize) -> EventIdSet<E>

Create an empty EventIdSet with the given capacity.

Source

pub fn clear(&mut self)

Clears the set, removing all event IDs.

Source

pub fn len(&self) -> usize

Returns the number of elements in the set.

Source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

Source

pub fn iter(&self) -> EventIdSetIter<'_, E>

Gets an iterator over the elements of the set.

Source§

impl<E> EventIdSet<E>
where E: Borrow<EventId> + Eq + Hash,

Source

pub fn contains(&self, event_id: &EventId) -> bool

Returns true if the set contains the specified event ID.

Source

pub fn get(&self, event_id: &EventId) -> Option<&E>

Returns a reference to the event ID in the set, if any, that is equal to the given one.

Source

pub fn insert(&mut self, event_id: E) -> bool

Adds an event ID to the set.

Returns whether the ID was newly inserted.

Source

pub fn remove(&mut self, event_id: &EventId) -> bool

Removes an event ID from the set.

Returns whether the ID was present in the set.

Source

pub fn take(&mut self, event_id: &EventId) -> Option<E>

Removes and returns the event ID in the set, if any, that is equal to the given one.

Source

pub fn intersection<'a>( &'a self, other: &'a EventIdSet<E>, ) -> EventIdSetIntersection<'a, E>

Visits the values representing the intersection, i.e., the values that are both in self and other.

Trait Implementations§

Source§

impl<E> Clone for EventIdSet<E>
where E: Clone + Borrow<EventId>,

Source§

fn clone(&self) -> EventIdSet<E>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E> Debug for EventIdSet<E>
where E: Debug + Borrow<EventId>,

Source§

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

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

impl<E> Default for EventIdSet<E>
where E: Borrow<EventId>,

Source§

fn default() -> EventIdSet<E>

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

impl<E> Extend<E> for EventIdSet<E>
where E: Borrow<EventId> + Hash + Eq,

Source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = E>,

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<E, const N: usize> From<[E; N]> for EventIdSet<E>
where E: Borrow<EventId> + Hash + Eq,

Source§

fn from(value: [E; N]) -> EventIdSet<E>

Converts to this type from the input type.
Source§

impl<E> FromIterator<E> for EventIdSet<E>
where E: Borrow<EventId> + Hash + Eq,

Source§

fn from_iter<T>(iter: T) -> EventIdSet<E>
where T: IntoIterator<Item = E>,

Creates a value from an iterator. Read more
Source§

impl<'a, E> IntoIterator for &'a EventIdSet<E>
where E: Borrow<EventId>,

Source§

type Item = &'a E

The type of the elements being iterated over.
Source§

type IntoIter = EventIdSetIter<'a, E>

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

fn into_iter(self) -> <&'a EventIdSet<E> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<E> IntoIterator for EventIdSet<E>
where E: Borrow<EventId>,

Source§

type Item = E

The type of the elements being iterated over.
Source§

type IntoIter = EventIdSetIntoIter<E>

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

fn into_iter(self) -> <EventIdSet<E> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<E> Freeze for EventIdSet<E>

§

impl<E> RefUnwindSafe for EventIdSet<E>
where E: RefUnwindSafe,

§

impl<E> Send for EventIdSet<E>
where E: Send,

§

impl<E> Sync for EventIdSet<E>
where E: Sync,

§

impl<E> Unpin for EventIdSet<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for EventIdSet<E>

§

impl<E> UnwindSafe for EventIdSet<E>
where E: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DropFlavorWrapper<T> for T

Source§

type Flavor = MayDrop

The DropFlavor that wraps T into Self
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> JsonCastable<CanonicalJsonValue> for T

Source§

impl<T> JsonCastable<Value> for T