pub enum RotationGate {
Local(LocalRotation),
Peer {
generation: NonZeroU64,
},
LocalAndPeer {
local: LocalRotation,
peer_generation: NonZeroU64,
},
}Variants§
Local(LocalRotation)
This device’s own rotation, with no unadopted peer generation.
Peer
A generation the store committed that this device has not adopted, with no local rotation of its own.
Fields
§
generation: NonZeroU64LocalAndPeer
Both facts at once: this device’s rotation, and a peer generation it has not adopted.
Implementations§
Source§impl RotationGate
impl RotationGate
pub fn pending_state(&self) -> RotationPendingState
Sourcepub fn with_candidate(
gate: Option<Self>,
generation: u64,
mutation: ObjectHash,
) -> Result<Self, RotationGateError>
pub fn with_candidate( gate: Option<Self>, generation: u64, mutation: ObjectHash, ) -> Result<Self, RotationGateError>
Stage mutation as this device’s rotation candidate, on whatever gate is
already open (None when none is).
Sourcepub fn commit_candidate(
gate: Option<Self>,
generation: u64,
mutation: ObjectHash,
) -> Result<Self, RotationGateError>
pub fn commit_candidate( gate: Option<Self>, generation: u64, mutation: ObjectHash, ) -> Result<Self, RotationGateError>
Promote this device’s staged candidate to its committed rotation.
Sourcepub fn merge_peer_commit(
gate: Option<Self>,
generation: u64,
) -> Result<Self, RotationGateError>
pub fn merge_peer_commit( gate: Option<Self>, generation: u64, ) -> Result<Self, RotationGateError>
Record that the store committed generation. Forward-only: an older
generation never displaces a newer one already recorded.
pub fn remove_candidate( self, generation: u64, mutation: ObjectHash, ) -> Result<Option<Self>, RotationGateError>
pub fn replace_candidate_mutation( self, generation: u64, previous: ObjectHash, replacement: ObjectHash, ) -> Result<Self, RotationGateError>
pub fn complete_local_adoption( self, generation: u64, mutation: ObjectHash, ) -> Result<Option<Self>, RotationGateError>
pub fn complete_peer_adoption( self, adopted_generation: u64, ) -> Result<Option<Self>, RotationGateError>
Sourcepub fn generation(&self) -> NonZeroU64
pub fn generation(&self) -> NonZeroU64
The newest generation the gate names. Reported through the replication
layer’s PendingRotation::pending_generation.
Trait Implementations§
Source§impl Clone for RotationGate
impl Clone for RotationGate
Source§fn clone(&self) -> RotationGate
fn clone(&self) -> RotationGate
Returns a duplicate of the value. Read more
1.0.0 · 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 RotationGate
impl Debug for RotationGate
Source§impl<'de> Deserialize<'de> for RotationGate
impl<'de> Deserialize<'de> for RotationGate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RotationGate
impl PartialEq for RotationGate
Source§impl Serialize for RotationGate
impl Serialize for RotationGate
impl Eq for RotationGate
impl StructuralPartialEq for RotationGate
Auto Trait Implementations§
impl Freeze for RotationGate
impl RefUnwindSafe for RotationGate
impl Send for RotationGate
impl Sync for RotationGate
impl Unpin for RotationGate
impl UnsafeUnpin for RotationGate
impl UnwindSafe for RotationGate
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.