pub async fn join_with_invite(
builder: CovenBuilder,
code: &str,
joiner: Joiner,
device_name: &str,
on_status: impl Fn(BootstrapStatus),
control: &JoinControl,
) -> Result<Option<CovenHandle>, BootstrapError>Expand description
Accept provider access, retain one signed request across restarts, and wait
for approval. Returns the open store, or None when declined or expired.
joiner is the new person with the name they typed, or a recovery, as the
invite’s InviteInfo::kind says; the other kind fails with
CodeError::WrongJoiner before anything changes. Dropping the future
before the join finds its admission preserves the unfinished join for a
subsequent call with the same invite, device name and person, or
resume_join. On Dropbox and
OneDrive the builder’s sign-in is kept on the device beside the saved code
until the join ends, and a later call without one uses it (§13.2).
control cancels the join or asks for a check for approval at once.
Cancelling before the request may have been sent removes the unpublished
installation; after, the call ends with BootstrapError::JoinRequestSent
and keeps it, as dropping does. Once the join finds its admission it
publishes the store, a cancel notwithstanding, then loads it, reporting
Loading; a failure while it loads returns BootstrapError::Published
with the open handle (§13.2). A store whose unfinished installation
holds a restore’s record is refused with StoreLockError::BootstrapPending
before anything changes (§13.4).