pub enum CircleCurrentState {
Active(Box<CircleAccessibleState>),
Closing(Box<CircleAccessibleState>),
Inactive(Box<CircleInactiveState>),
Deleted(Box<CircleCurrentControl>),
ControlConflict {
branches: Vec<CircleCurrentControl>,
},
}Variants§
Active(Box<CircleAccessibleState>)
Closing(Box<CircleAccessibleState>)
Inactive(Box<CircleInactiveState>)
Deleted(Box<CircleCurrentControl>)
ControlConflict
Fields
branches: Vec<CircleCurrentControl>Implementations§
Source§impl CircleCurrentState
impl CircleCurrentState
pub fn from_verified( candidate_family: CandidateFamilyId, activation: &VerifiedCircleReference, ) -> Result<Self, CircleStateError>
pub fn advance(self, next: Self) -> Result<Self, CircleStateError>
pub fn without_local_access(self) -> Self
pub fn verify(&self) -> bool
pub fn circle_id(&self) -> CircleId
Sourcepub fn rotation_required(
&self,
active_store_members: &BTreeSet<String>,
) -> Option<RotationRequired>
pub fn rotation_required( &self, active_store_members: &BTreeSet<String>, ) -> Option<RotationRequired>
A rotation is required when the resolved roster names identities that hold
no active Store membership grant. Only meaningful for states that carry a
roster; Inactive and ControlConflict return None.
Sourcepub fn derived_state(
&self,
active_store_members: &BTreeSet<String>,
) -> CircleState
pub fn derived_state( &self, active_store_members: &BTreeSet<String>, ) -> CircleState
Map this internal current state to the public crate::circle::CircleState.
This is the single place the derivation lives.
Rotation-required is surfaced only for an Active Circle. A Closing
Circle whose roster still names a removed Store member stays Closing
rather than reporting RotationRequired: an epoch close is already the
exit path a rotation drives toward, so once a close is in flight the close
is the operative state to show. Inactive, Deleted, and
ControlConflict carry no roster to make a rotation judgment from.
Sourcepub fn display(
&self,
identity_pubkey: &str,
) -> (Option<String>, Option<CircleRole>)
pub fn display( &self, identity_pubkey: &str, ) -> (Option<String>, Option<CircleRole>)
The Circle’s display name and the local identity’s role, for the public
list item. Both come from the resolved roster and metadata an accessible
state carries (Active or Closing); an Inactive, Deleted, or
conflicted Circle resolves neither.
pub fn active( &self, ) -> Option<(&CircleCurrentControl, &CircleAccessLeaf, &CircleMaterializedRoster, &CircleMetadata)>
pub fn active_record_count(&self) -> usize
The authoring state a terminal deletion signs from. Deletion is the one
command that authors from a closing epoch, so it accepts any state whose
local device holds owner access — Active or Closing — and reads the
frozen epoch spine through the control’s access_epoch. Inactive,
Deleted, and ControlConflict hold no owner access to sign a successor.
pub fn epoch_access( &self, expected_control: &CircleControlCoord, ) -> Result<Option<CircleEpochAccess>, CircleStateError>
pub fn resolved_control(&self) -> Option<&CircleCurrentControl>
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Whether this Circle’s control history has terminated in a deletion.
Sourcepub fn conflict_branches(&self) -> Option<Vec<CircleControlCoord>>
pub fn conflict_branches(&self) -> Option<Vec<CircleControlCoord>>
The retained conflicting branch coordinates, in canonical order, when
this Circle’s control history forked into concurrent valid successors.
None for every resolved state.
pub fn closing_control(&self) -> Option<&PreparedCircleControl>
pub fn active_current_mut_for_test( &mut self, ) -> Option<&mut CircleCurrentControl>
Trait Implementations§
Source§impl Clone for CircleCurrentState
impl Clone for CircleCurrentState
Source§fn clone(&self) -> CircleCurrentState
fn clone(&self) -> CircleCurrentState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CircleCurrentState
impl Debug for CircleCurrentState
Source§impl<'de> Deserialize<'de> for CircleCurrentState
impl<'de> Deserialize<'de> for CircleCurrentState
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>,
Source§impl PartialEq for CircleCurrentState
impl PartialEq for CircleCurrentState
Source§impl Serialize for CircleCurrentState
impl Serialize for CircleCurrentState
impl Eq for CircleCurrentState
impl StructuralPartialEq for CircleCurrentState
Auto Trait Implementations§
impl Freeze for CircleCurrentState
impl RefUnwindSafe for CircleCurrentState
impl Send for CircleCurrentState
impl Sync for CircleCurrentState
impl Unpin for CircleCurrentState
impl UnsafeUnpin for CircleCurrentState
impl UnwindSafe for CircleCurrentState
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> 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
§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
key and return true if they are equal.