Struct scylla::transport::locator::ReplicasOrdered
source · 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 (for token-ring tables) or with the order defined by tablet data (for tablet tables).
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 does not allocate.
For the remaining others, unfortunately, allocation is inevitable.
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