Skip to main content

Membership

Struct Membership 

Source
pub struct Membership { /* private fields */ }
Expand description

A chain derived exclusively from verified signed predecessors. No server observation or resulting-state DTO can construct this value directly.

Implementations§

Source§

impl Membership

Source

pub fn verify_initial_key( &self, key: &LocalSharedStatePackageKey, ) -> Result<VerifiedKeys>

Initial-generation-only construction for existing protected seed authority.

Source§

impl Membership

Source

pub fn from_publication( genesis: &Genesis, descriptor: &[u8], publication: &[u8], ) -> Result<Self>

Source

pub fn head(&self) -> [u8; 32]

Source

pub fn sequence(&self) -> u64

Source

pub fn has_device(&self, device: [u8; 32]) -> bool

Source

pub fn devices(&self) -> impl Iterator<Item = [u8; 32]> + '_

Source

pub fn admissions(&self) -> impl Iterator<Item = ([u8; 32], u64)> + '_

Active devices with the membership sequence that admitted each; the device that set up sync has sequence 0.

Source

pub fn has_admission(&self, handle: [u8; 32]) -> bool

Whether an active member owns this admitted invitation.

Source

pub fn record_action(record: &[u8]) -> Result<([u8; 32], u8)>

Signer and action framing, not signature or successor verification.

Source

pub fn device_count(&self) -> usize

Source

pub fn genesis(&self) -> &Genesis

Source

pub fn publication(&self) -> &Publication

Source

pub fn extends(&self, previous: &Self) -> bool

Ancestry, not a claim that either checkpoint is the latest server head.

Source

pub fn authenticate( &self, auth: &Authentication<'_>, ancestor: bool, ) -> Result<()>

Authenticate the actual credential before examining its requested head.

Source

pub fn head_at(&self, sequence: u64) -> Option<[u8; 32]>

Source

pub fn validate_key(&self, key: &LocalSharedStatePackageKey) -> Result<()>

Source

pub fn contains_head(&self, head: &[u8; 32]) -> bool

Source

pub fn append( &self, declaration: &[u8], request: &[u8], record: &[u8], ) -> Result<Self>

Validate one exact successor without mutating the trusted predecessor. Expiry, current bearer authorization and atomic server CAS are separate.

Source

pub fn ensure_change_capacity(&self) -> Result<()>

Room for the costlier outcome of an invitation: withdrawing it with a freeze and key rotation, which also covers admitting its device.

Source

pub fn rotation_pending(&self) -> bool

Source

pub fn generations(&self) -> &[Generation]

Source

pub fn current_generation(&self) -> &Generation

Source

pub fn generation_allows(&self, generation: [u8; 32], sequence: u64) -> bool

Signed interval eligibility, not proof of server acceptance or completeness.

Trait Implementations§

Source§

impl Clone for Membership

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. 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.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.