Skip to main content

invite_closed

Function invite_closed 

Source
pub fn invite_closed(
    closed: &Closed,
    network: &Network,
    invitation: &Invitation,
    code: &PairingCode,
    confirm: &'_ mut dyn FnMut(&Invitee) -> bool,
    (showing, stop): (Showing<'_>, &AtomicBool),
    now: &dyn Fn() -> u64,
    rng: &mut impl CryptoRng,
) -> Result<Invited, NodeError>
Expand description

Invites a user to a shared space, as invite does, as a replica of an admin of it whose library is closed: it checks the role before the code is shown, waits as showing says, until stop is set, without the library open, so that other programs use it meanwhile, and opens it once a replica connects, closing it again after a try that failed before the code matched.

ยงErrors

Returns the errors of invite, NodeError::InvitationExpired also once stop is set, and NodeError::Store with StoreError::InUse if another program kept the library to itself after a replica connected.