Skip to main content

JoiningIdentity

Struct JoiningIdentity 

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

An unpublished member identity and its immutable request. The member id is the one the invite fixes; the keys are this device’s fresh pair. The only durable local copy is encrypted with the invite secret, bound to the complete code. No member keys or provider credentials enter final custody while waiting. One join holds it, from preparing or resuming the request until the join ends.

Implementations§

Source§

impl JoiningIdentity

Source

pub fn prepare( directory: &StoreDir, code: &InviteCode, device: DeviceId, device_name: &str, name: Option<String>, circle: &CircleTerms, ids: &dyn IdSource, ) -> Result<Self, SyncError>

Restore a fixed request or prepare it before any provider mutation. A new request names device, the joining installation’s id, for the approval to register, name, the new person’s name: given when the invite admits a new person, absent when it admits a member’s new keys, as the code says, and the circle circle describes, with ids from ids. A changed invite, device name, name or circle name cannot silently reuse another request.

Source

pub fn prepare_for_test( directory: &StoreDir, code: &InviteCode, device: DeviceId, device_name: &str, name: Option<String>, ) -> Result<Self, SyncError>

prepare with a circle named “Circle” at base zero and random ids, for a test whose join doesn’t care about its circle.

Source

pub fn resume( directory: &StoreDir, code: &InviteCode, ) -> Result<Self, SyncError>

Continue a join from its saved request, with the device name and person that request carries (§13.2). A join’s code is saved only after its request, so a missing request is damaged local state.

Source

pub fn identity(&self) -> MemberIdentity

The invite’s member id with this device’s pair, for composing the unpublished member custody.

Source

pub fn approver(&self) -> DeviceId

The inviting device: only its admission admits this request (§13.2).

Source

pub fn read_through(&self) -> u64

The inviting device’s applied slot when it made the invite: copies for this request can only follow it (§13.2).

Source

pub fn device_name(&self) -> &str

The name the device gave itself in its request, which its admission registers it with.

Source

pub fn circle_name(&self) -> &str

The name of the circle the request makes.

Source

pub fn circle(&self) -> &JoiningCircle

The circle the request makes, with the key’s copy it carries.

Source

pub fn joiner(&self) -> &Joiner

Who the request is for. A new person’s name is kept here until the join publishes the store (§13.2).

Source

pub fn confirmation(&self) -> ConfirmationNumber

The number the admin compares before approving; the admin’s device computes it from the same keys (format.md D11).

Source

pub fn path(&self) -> &ObjectPath

The request’s path, named by its invite.

Source

pub fn attempted(&self) -> bool

Whether publication may already have happened before an interruption.

Source

pub fn accepted(&self) -> bool

Whether the invite’s share may have been accepted for the joining account while the request is unsent: a cancel takes it back before it removes the join (§13.2).

Source

pub fn ended(&self) -> bool

Whether the join already decided to end, and only its deletion is left (§13.4).

Source

pub fn opened(&self) -> bool

Whether this member’s keys have opened, in this call or an earlier one: the admission carrying them is in history, and the join never reports waiting for approval again (§13.2, E10).

Source

pub fn record_acceptance(&mut self) -> Result<(), SyncError>

Record, before accepting the invite’s share, that the acceptance may be in the joining account, so a cancel before sending, in this call or after a restart, takes it back (§13.2). A join already accepted, or one that may have sent, is past this.

Source

pub fn record_attempt(&mut self) -> Result<(), SyncError>

Record possible publication before issuing it. On restart a request that is absent with nothing in its place is sent again; an ended invite’s marker in its place ends the join (resend).

Source

pub fn record_refusal(&mut self) -> Result<(), SyncError>

The provider refused the request, so it was never published: a retry sends it again, and a cancel takes back the acceptance that came before it (§13.2).

Source

pub async fn publish(&self, storage: &dyn Storage) -> Result<bool, SyncError>

Publish the recorded immutable request. An occupied path must hold exactly these bytes (§19.3). false, sending nothing, once the inviting device is gone for good: an admin’s device has ended its requests, and none would ever be answered (§13.2).

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
§

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> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

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