pub enum PartitionState {
Active(Placement),
Migrating {
from: Placement,
to: Placement,
phase: Phase,
},
}Expand description
A partition’s placement state: settled, or migrating between two placements.
Not #[non_exhaustive]: routing must interpret every state, so adding one
should force every match to be revisited (docs/03).
Variants§
Active(Placement)
Settled at a single placement.
Migrating
Moving from one placement to another; the phase gates writes.
Implementations§
Source§impl PartitionState
impl PartitionState
Sourcepub fn read_placement(&self) -> &Placement
pub fn read_placement(&self) -> &Placement
The single placement reads resolve to right now, from until the
migration completes, never a split of both (INV-M4).
Sourcepub fn write_placement(&self) -> Option<&Placement>
pub fn write_placement(&self) -> Option<&Placement>
The placement a write may commit to right now, or None if writes are
currently blocked, the Cutover window (INV-M1).
Sourcepub fn is_migrating(&self) -> bool
pub fn is_migrating(&self) -> bool
Whether a migration is in flight.
Trait Implementations§
Source§impl Clone for PartitionState
impl Clone for PartitionState
Source§fn clone(&self) -> PartitionState
fn clone(&self) -> PartitionState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PartitionState
impl Debug for PartitionState
impl Eq for PartitionState
Source§impl PartialEq for PartitionState
impl PartialEq for PartitionState
Source§fn eq(&self, other: &PartitionState) -> bool
fn eq(&self, other: &PartitionState) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PartitionState
Auto Trait Implementations§
impl Freeze for PartitionState
impl RefUnwindSafe for PartitionState
impl Send for PartitionState
impl Sync for PartitionState
impl Unpin for PartitionState
impl UnsafeUnpin for PartitionState
impl UnwindSafe for PartitionState
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