pub struct MembershipChain { /* private fields */ }Implementations§
Source§impl MembershipChain
impl MembershipChain
pub fn signed_conflict_resolution( &self, store_root_hash: ObjectHash, selection: MembershipConflictSelection, replacement_membership: GrantStreamAnchor, replacement_acceptance: OwnerConflictResolutionAcceptance, signer: &UserKeypair, ) -> Result<StoreMembershipConflictResolution, MembershipError>
pub fn signed_set_member_with_anchor_and_wrapped_key_in_stream( &self, signer: &UserKeypair, stream_id: AuthorStreamId, user_pubkey: String, provider_account_email: Option<String>, role: MemberRole, membership: Option<GrantStreamAnchor>, wrapped_key: WrappedStoreKeyRef, created_at: String, ) -> Result<MembershipEntry, MembershipError>
pub fn signed_finalize_owner_promotion_in_stream( &self, root: &StoreRootRef, promoter: &StoreDeviceRegistration, candidate: &StoreDeviceRegistration, acceptance: OwnerPromotionAcceptance, signer: &UserKeypair, wrapped_key: WrappedStoreKeyRef, created_at: String, ) -> Result<MembershipEntry, MembershipError>
pub fn signed_remove_member_with_wrapped_keys_in_stream( &self, signer: &UserKeypair, stream_id: AuthorStreamId, user_pubkey: String, wrapped_keys: Vec<WrappedStoreKeyRef>, created_at: String, ) -> Result<MembershipEntry, MembershipError>
pub fn signed_remove_member_with_owner_barrier_state( &self, signer: &UserKeypair, stream_id: AuthorStreamId, user_pubkey: String, wrapped_keys: Vec<WrappedStoreKeyRef>, device_state: StoreDeviceStateRef, created_at: String, ) -> Result<MembershipEntry, MembershipError>
pub fn signed_resolution_activation_in_stream( &self, store_root_hash: ObjectHash, signer: &UserKeypair, stream_id: AuthorStreamId, reference: StoreMembershipConflictResolutionRef, resolution: &StoreMembershipConflictResolution, created_at: String, ) -> Result<MembershipEntry, MembershipError>
pub fn signed_set_member_in_stream( &self, signer: &UserKeypair, stream_id: AuthorStreamId, user_pubkey: String, provider_account_email: Option<String>, role: MemberRole, created_at: String, ) -> Result<MembershipEntry, MembershipError>
pub fn signed_remove_member_in_stream( &self, signer: &UserKeypair, stream_id: AuthorStreamId, user_pubkey: String, created_at: String, ) -> Result<MembershipEntry, MembershipError>
Source§impl MembershipChain
impl MembershipChain
pub fn can_write_now(&self, pubkey: &str) -> bool
Sourcepub fn is_member_now(&self, pubkey: &str) -> bool
pub fn is_member_now(&self, pubkey: &str) -> bool
Whether pubkey holds any active grant — a member of this Store now,
whatever role it has.
Distinct from any question about that member’s devices. Removing a member ends its grants here and rotates the key; it does not mark the devices it registered inactive, because device status tracks a device’s own lifecycle — a lost laptop belonging to a member in good standing. Anything asking “could this principal still be owed history” has to ask membership, not device status.
pub fn is_owner_now(&self, pubkey: &str) -> bool
pub fn active_grant( &self, grant_id: &MembershipGrantId, ) -> Option<&MembershipGrantRecord>
pub fn current_members(&self) -> Vec<(String, MemberRole)>
pub fn active_wrapped_keys_for( &self, recipient_pubkey: &str, ) -> Vec<WrappedStoreKeyRef>
pub fn current_member_provider_email(&self, pubkey: &str) -> Option<&str>
pub fn active_grant_ids(&self, pubkey: &str) -> BTreeSet<MembershipGrantId>
pub fn active_owner_grant(&self, pubkey: &str) -> Option<MembershipGrantId>
Source§impl MembershipChain
impl MembershipChain
pub fn from_entries_with_coords_and_heads_and_provider_admin( entries: Vec<(MembershipCoord, MembershipEntry)>, heads: Vec<(MembershipHeadRef, AuthorHead)>, provider_admin: ProviderAdminState, ) -> Result<Self, MembershipError>
pub fn entries(&self) -> &[MembershipEntry] ⓘ
pub fn status(&self) -> &MembershipStatus
pub fn head_refs(&self) -> &[MembershipHeadRef]
pub fn head_ref_for_stream( &self, author: &str, grant: &MembershipGrantId, stream_id: AuthorStreamId, ) -> Option<&MembershipHeadRef>
Sourcepub fn covers_heads(&self, heads: &[MembershipHeadRef]) -> bool
pub fn covers_heads(&self, heads: &[MembershipHeadRef]) -> bool
Whether this chain reaches at least as far as heads on every stream
they name.
A membership stream is a hash-linked list walked from its founder anchor forward: a walk cannot start in the middle, so two walks of the same stream verify the same heads up to the shorter one’s end. A chain that covers a set of cursors therefore contains everything a walk anchored at those cursors would have verified, and can stand in for it.
pub fn membership_anchor( &self, grant: &MembershipGrantId, ) -> Option<&GrantStreamAnchor>
pub fn membership_stream_id( &self, grant: &MembershipGrantId, ) -> Option<AuthorStreamId>
pub fn activated_membership_streams( &self, ) -> Vec<(MembershipStreamKey, GrantStreamAnchor)>
pub fn activate_head_ref( &mut self, reference: MembershipHeadRef, ) -> Result<(), MembershipError>
pub fn resolution_refs(&self) -> &[StoreMembershipConflictResolutionRef]
pub fn conflict(&self) -> Option<&MembershipConflict>
pub fn ensure_resolved(&self) -> Result<(), MembershipError>
pub fn store_id(&self) -> Option<&str>
pub fn founder_coord(&self) -> Option<&MembershipCoord>
pub fn founder_pubkey(&self) -> Option<&str>
pub fn is_founded_by(&self, owner_pubkey: &str) -> bool
pub fn add_entry( &mut self, entry: MembershipEntry, ) -> Result<(), MembershipError>
pub fn add_entry_at( &mut self, coord: MembershipCoord, entry: MembershipEntry, ) -> Result<(), MembershipError>
pub fn with_exact_entry( &self, entry: &MembershipEntry, ) -> Result<Self, MembershipError>
pub fn contains_coord(&self, expected: &MembershipCoord) -> bool
pub fn effectively_contains_coord(&self, expected: &MembershipCoord) -> bool
Sourcepub fn effective_frontier(&self) -> Vec<MembershipCoord>
pub fn effective_frontier(&self) -> Vec<MembershipCoord>
Effective authoring frontier after causal pruning.
pub fn causally_includes(&self, predecessor: &MembershipChain) -> bool
pub fn next_stream_position( &self, author: &str, grant: &MembershipGrantId, stream_id: AuthorStreamId, ) -> Result<(u64, Option<ObjectHash>), MembershipError>
pub fn apply_resolutions( &mut self, store_root_hash: ObjectHash, resolutions: &[(StoreMembershipConflictResolutionRef, StoreMembershipConflictResolution)], ) -> Result<(), MembershipError>
pub fn from_entries( entries: Vec<MembershipEntry>, ) -> Result<Self, MembershipError>
Trait Implementations§
Source§impl Clone for MembershipChain
impl Clone for MembershipChain
Source§fn clone(&self) -> MembershipChain
fn clone(&self) -> MembershipChain
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more