pub async fn join_with_invite(
builder: CovenBuilder,
code: &str,
name: Option<String>,
circle_name: &str,
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.
name is the name the new person typed when the invite admits a new
person, and None when it admits a member’s new keys, as the invite’s
InviteInfo::admits says; the other fails with CodeError::WrongJoiner
before anything changes. circle_name names the circle the request makes
for the person, which the admission creates with them as its only member
(§13.2). Dropping the future before the join finds its
admission preserves the unfinished join for a subsequent call with the
same invite, device name, name and circle name, 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).