pub struct UpdateIterator<DC>{ /* private fields */ }Expand description
Iterator over updates in the cache.
This is a crucial part of the write-back mechanism. Despite its name reflecting
the primary function of the struct, it does not implement the Iterator trait but provides a next() method
to iterate over updates. This is because it incorporates aspects of a collection’s behavior, making it more
than just a simple iterator.
Note that an important part of implementing a write back method is to remember to confirm the successfully
processed updates. Unconfirmed ones will be put back into the update pool for later processing. Confirmation can be
done by calling the confirm_all() method or by calling confirm() on each item returned by the next() method.
The former approach is useful for transactional updates.
Implementations§
Source§impl<DC> UpdateIterator<DC>
impl<DC> UpdateIterator<DC>
Sourcepub fn confirm_all(&self)
pub fn confirm_all(&self)
Confirm all updates at once. Useful for transactional updates.
pub fn is_empty(&self) -> bool
Sourcepub fn next(&self) -> Option<UpdateIteratorItem<DC>>
pub fn next(&self) -> Option<UpdateIteratorItem<DC>>
Get the next update item to process or None if there are no more items left.
It is possible that not all of the updates, bundled with the current iterator, will be returned by this method. This can happen due to the concurrent nature of the cache and the fact that updates can be flushed by other threads.
Trait Implementations§
Source§impl<DC> Child for UpdateIterator<DC>
impl<DC> Child for UpdateIterator<DC>
Source§type WeakParent = Weak<Cache<DC>>
type WeakParent = Weak<Cache<DC>>
Source§type FXPParent = Arc<Cache<DC>>
type FXPParent = Arc<Cache<DC>>
child_build! and child_builder! macros.Source§fn parent_downgrade(&self) -> Self::WeakParent
fn parent_downgrade(&self) -> Self::WeakParent
fn __fxplus_parent(parent: Self::WeakParent) -> Self::FXPParent
Source§impl<DC> Parent for UpdateIterator<DC>
impl<DC> Parent for UpdateIterator<DC>
Source§type WeakSelf = Weak<UpdateIterator<DC>>
type WeakSelf = Weak<UpdateIterator<DC>>
fn __fxplus_myself_downgrade(&self) -> Weak<Self>
impl<DC> FXStruct for UpdateIterator<DC>
Auto Trait Implementations§
impl<DC> !Freeze for UpdateIterator<DC>
impl<DC> !RefUnwindSafe for UpdateIterator<DC>
impl<DC> Send for UpdateIterator<DC>
impl<DC> Sync for UpdateIterator<DC>
impl<DC> Unpin for UpdateIterator<DC>
impl<DC> !UnwindSafe for UpdateIterator<DC>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.