Skip to main content

MembershipChain

Struct MembershipChain 

Source
pub struct MembershipChain { /* private fields */ }

Implementations§

Source§

impl MembershipChain

Source

pub fn signed_conflict_resolution( &self, store_root_hash: ObjectHash, selection: MembershipConflictSelection, replacement_membership: GrantStreamAnchor, replacement_acceptance: OwnerConflictResolutionAcceptance, signer: &UserKeypair, ) -> Result<StoreMembershipConflictResolution, MembershipError>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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

Source

pub fn can_write_now(&self, pubkey: &str) -> bool

Source

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.

Source

pub fn is_owner_now(&self, pubkey: &str) -> bool

Source

pub fn authorizes_write_authority( &self, authority: &MembershipGrantCreationAuthority, pubkey: &str, ) -> bool

Source

pub fn active_grant( &self, grant_id: &MembershipGrantId, ) -> Option<&MembershipGrantRecord>

Source

pub fn current_members(&self) -> Vec<(String, MemberRole)>

Source

pub fn active_wrapped_keys_for( &self, recipient_pubkey: &str, ) -> Vec<WrappedStoreKeyRef>

Source

pub fn wrapped_key_authority_for( &self, recipient_pubkey: &str, ) -> Result<Vec<WrappedStoreKeyRef>, MembershipError>

Source

pub fn current_member_provider_email(&self, pubkey: &str) -> Option<&str>

Source

pub fn write_grant_authority( &self, pubkey: &str, ) -> Option<MembershipGrantCreationAuthority>

Source

pub fn active_grant_ids(&self, pubkey: &str) -> BTreeSet<MembershipGrantId>

Source

pub fn active_owner_grant(&self, pubkey: &str) -> Option<MembershipGrantId>

Source§

impl MembershipChain

Source

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>

Source

pub fn entries(&self) -> &[MembershipEntry]

Source

pub fn status(&self) -> &MembershipStatus

Source

pub fn head_refs(&self) -> &[MembershipHeadRef]

Source

pub fn head_ref_for_stream( &self, author: &str, grant: &MembershipGrantId, stream_id: AuthorStreamId, ) -> Option<&MembershipHeadRef>

Source

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.

Source

pub fn membership_anchor( &self, grant: &MembershipGrantId, ) -> Option<&GrantStreamAnchor>

Source

pub fn membership_stream_id( &self, grant: &MembershipGrantId, ) -> Option<AuthorStreamId>

Source

pub fn activated_membership_streams( &self, ) -> Vec<(MembershipStreamKey, GrantStreamAnchor)>

Source

pub fn activate_head_ref( &mut self, reference: MembershipHeadRef, ) -> Result<(), MembershipError>

Source

pub fn resolution_refs(&self) -> &[StoreMembershipConflictResolutionRef]

Source

pub fn conflict(&self) -> Option<&MembershipConflict>

Source

pub fn ensure_resolved(&self) -> Result<(), MembershipError>

Source

pub fn store_id(&self) -> Option<&str>

Source

pub fn founder_coord(&self) -> Option<&MembershipCoord>

Source

pub fn founder_pubkey(&self) -> Option<&str>

Source

pub fn is_founded_by(&self, owner_pubkey: &str) -> bool

Source

pub fn add_entry( &mut self, entry: MembershipEntry, ) -> Result<(), MembershipError>

Source

pub fn add_entry_at( &mut self, coord: MembershipCoord, entry: MembershipEntry, ) -> Result<(), MembershipError>

Source

pub fn with_exact_entry( &self, entry: &MembershipEntry, ) -> Result<Self, MembershipError>

Source

pub fn contains_coord(&self, expected: &MembershipCoord) -> bool

Source

pub fn effectively_contains_coord(&self, expected: &MembershipCoord) -> bool

Source

pub fn reusable_author_streams( &self, author_pubkey: &str, grant: &MembershipGrantId, ) -> BTreeSet<AuthorStreamId>

Source

pub fn effective_frontier(&self) -> Vec<MembershipCoord>

Effective authoring frontier after causal pruning.

Source

pub fn causally_includes(&self, predecessor: &MembershipChain) -> bool

Source

pub fn next_stream_position( &self, author: &str, grant: &MembershipGrantId, stream_id: AuthorStreamId, ) -> Result<(u64, Option<ObjectHash>), MembershipError>

Source

pub fn apply_resolutions( &mut self, store_root_hash: ObjectHash, resolutions: &[(StoreMembershipConflictResolutionRef, StoreMembershipConflictResolution)], ) -> Result<(), MembershipError>

Source

pub fn from_entries( entries: Vec<MembershipEntry>, ) -> Result<Self, MembershipError>

Trait Implementations§

Source§

impl Clone for MembershipChain

Source§

fn clone(&self) -> MembershipChain

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MembershipChain

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,