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
impl JoiningIdentity
Sourcepub fn prepare(
directory: &StoreDir,
code: &InviteCode,
device: DeviceId,
device_name: &str,
name: Option<String>,
circle: &CircleTerms,
ids: &dyn IdSource,
) -> Result<Self, SyncError>
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.
Sourcepub fn prepare_for_test(
directory: &StoreDir,
code: &InviteCode,
device: DeviceId,
device_name: &str,
name: Option<String>,
) -> Result<Self, SyncError>
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.
Sourcepub fn resume(
directory: &StoreDir,
code: &InviteCode,
) -> Result<Self, SyncError>
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.
Sourcepub fn identity(&self) -> MemberIdentity
pub fn identity(&self) -> MemberIdentity
The invite’s member id with this device’s pair, for composing the unpublished member custody.
Sourcepub fn approver(&self) -> DeviceId
pub fn approver(&self) -> DeviceId
The inviting device: only its admission admits this request (§13.2).
Sourcepub fn read_through(&self) -> u64
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).
Sourcepub fn device_name(&self) -> &str
pub fn device_name(&self) -> &str
The name the device gave itself in its request, which its admission registers it with.
Sourcepub fn circle_name(&self) -> &str
pub fn circle_name(&self) -> &str
The name of the circle the request makes.
Sourcepub fn circle(&self) -> &JoiningCircle
pub fn circle(&self) -> &JoiningCircle
The circle the request makes, with the key’s copy it carries.
Sourcepub fn joiner(&self) -> &Joiner
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).
Sourcepub fn confirmation(&self) -> ConfirmationNumber
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).
Sourcepub fn path(&self) -> &ObjectPath
pub fn path(&self) -> &ObjectPath
The request’s path, named by its invite.
Sourcepub fn attempted(&self) -> bool
pub fn attempted(&self) -> bool
Whether publication may already have happened before an interruption.
Sourcepub fn accepted(&self) -> bool
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).
Sourcepub fn ended(&self) -> bool
pub fn ended(&self) -> bool
Whether the join already decided to end, and only its deletion is left (§13.4).
Sourcepub fn opened(&self) -> bool
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).
Sourcepub fn record_acceptance(&mut self) -> Result<(), SyncError>
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.
Sourcepub fn record_attempt(&mut self) -> Result<(), SyncError>
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).
Sourcepub fn record_refusal(&mut self) -> Result<(), SyncError>
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).
Sourcepub async fn publish(&self, storage: &dyn Storage) -> Result<bool, SyncError>
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§
impl Freeze for JoiningIdentity
impl RefUnwindSafe for JoiningIdentity
impl Send for JoiningIdentity
impl Sync for JoiningIdentity
impl Unpin for JoiningIdentity
impl UnsafeUnpin for JoiningIdentity
impl UnwindSafe for JoiningIdentity
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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