Skip to main content

invite

Function invite 

Source
pub fn invite<T: Transport, I: Inviting>(
    transport: &mut T,
    inviting: &mut I,
    code: &PairingCode,
    rng: &mut impl CryptoRng,
) -> Result<Invitation, SyncError>
Expand description

Invites the joiner at the other end of transport to a space, as the admin’s replica, with the code it showed. The code is spent whatever happens.

§Errors

Returns SyncError::WrongCode if the joiner typed another code, on either side, SyncError::Declined if the person declined who asks, SyncError::Ended with Reason::HoldsSpace if the joiner holds the space already, and other errors if the connection fails, the joiner breaks the protocol or does not join, or the member cannot be recorded; in all of these, nothing is recorded.