pub struct ReplicasOrdered<'a> { /* private fields */ }
Expand description
Represents a sequence of replicas for a given token and strategy, ordered according to the ring order.
This container can only be created by calling ReplicaSet::into_replicas_ordered()
,
and either it can borrow precomputed replica lists living in the locator (in case of SimpleStrategy)
or it must compute them on-demand (in case of NetworkTopologyStrategy).
The computation is lazy (performed by ReplicasOrderedIterator
upon call to next()
).
For obtaining the primary replica, no allocations are needed. Therefore, the first call
to next()
is optimised and doesn not allocate.
For the remaining others, unfortunately, allocation is unevitable.
Trait Implementations§
Source§impl<'a> IntoIterator for ReplicasOrdered<'a>
impl<'a> IntoIterator for ReplicasOrdered<'a>
Auto Trait Implementations§
impl<'a> Freeze for ReplicasOrdered<'a>
impl<'a> !RefUnwindSafe for ReplicasOrdered<'a>
impl<'a> Send for ReplicasOrdered<'a>
impl<'a> Sync for ReplicasOrdered<'a>
impl<'a> Unpin for ReplicasOrdered<'a>
impl<'a> !UnwindSafe for ReplicasOrdered<'a>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more