pub struct FixedSizeEventBuffer<const N: usize> { /* private fields */ }Expand description
A fixed-size event buffer.
Implementations§
Source§impl<const N: usize> FixedSizeEventBuffer<N>
impl<const N: usize> FixedSizeEventBuffer<N>
Sourcepub fn has_event_type(&self, event_type: EventType) -> bool
pub fn has_event_type(&self, event_type: EventType) -> bool
Returns true if this event buffer contains one or more events of the given event type.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the event buffer, removing all events and resetting the seen event types.
Sourcepub fn try_push(&mut self, event: Event) -> Option<Event>
pub fn try_push(&mut self, event: Event) -> Option<Event>
Attempts to append an event to the back of the event buffer.
If the event buffer is full, Some is returned with the original event.
Sourcepub fn events<T: EventKind>(&self) -> impl Iterator<Item = &T>
pub fn events<T: EventKind>(&self) -> impl Iterator<Item = &T>
Returns an iterator over the events of type T in the event buffer.
Sourcepub fn events_mut<T: EventKind>(&mut self) -> impl Iterator<Item = &mut T>
pub fn events_mut<T: EventKind>(&mut self) -> impl Iterator<Item = &mut T>
Returns an iterator over mutable references to the events of type T in the event buffer.
Sourcepub fn into_events<T: EventKind>(self) -> impl Iterator<Item = T>
pub fn into_events<T: EventKind>(self) -> impl Iterator<Item = T>
Consumes the event buffer, returning an iterator over the events of type T it held.
Events of other types are dropped.
Sourcepub fn retain_events<T, F>(&mut self, predicate: F)
pub fn retain_events<T, F>(&mut self, predicate: F)
Retains only the events of type T for which predicate returns true.
Events of other types are kept. The remaining events keep their relative order.
Sourcepub fn take_events<T: EventKind>(&mut self) -> impl Iterator<Item = T>
pub fn take_events<T: EventKind>(&mut self) -> impl Iterator<Item = T>
Removes all events of type T from the event buffer, returning them.
Events of other types are kept. Event order isn’t preserved.
Trait Implementations§
Source§impl<const N: usize> Clone for FixedSizeEventBuffer<N>
impl<const N: usize> Clone for FixedSizeEventBuffer<N>
Source§fn clone(&self) -> FixedSizeEventBuffer<N>
fn clone(&self) -> FixedSizeEventBuffer<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const N: usize> Debug for FixedSizeEventBuffer<N>
impl<const N: usize> Debug for FixedSizeEventBuffer<N>
Source§impl<const N: usize> Default for FixedSizeEventBuffer<N>
impl<const N: usize> Default for FixedSizeEventBuffer<N>
Source§impl<const N: usize> Dispatchable for FixedSizeEventBuffer<N>
impl<const N: usize> Dispatchable for FixedSizeEventBuffer<N>
Source§fn item_count(&self) -> usize
fn item_count(&self) -> usize
Source§impl<const N: usize> IntoIterator for FixedSizeEventBuffer<N>
impl<const N: usize> IntoIterator for FixedSizeEventBuffer<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for FixedSizeEventBuffer<N>
impl<const N: usize> !RefUnwindSafe for FixedSizeEventBuffer<N>
impl<const N: usize> Send for FixedSizeEventBuffer<N>
impl<const N: usize> Sync for FixedSizeEventBuffer<N>
impl<const N: usize> Unpin for FixedSizeEventBuffer<N>
impl<const N: usize> UnsafeUnpin for FixedSizeEventBuffer<N>
impl<const N: usize> !UnwindSafe for FixedSizeEventBuffer<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more