Skip to main content

accept

Function accept 

Source
pub fn accept<T: Transport, A: Accepting>(
    transport: &mut T,
    request: &InvitationRequest,
    accepting: &mut A,
    code: &PairingCode,
    rng: &mut impl CryptoRng,
) -> Result<Invitation, SyncError>
Expand description

Joins a space by the invitation of the admin’s replica at the other end of transport, with the code that the person typed and request, which says who asks, and takes the space as accepting does.

§Errors

Returns SyncError::WrongCode if the code did not match, on either side, SyncError::HoldsSpace if the library holds the space already, SyncError::Ended with Reason::Declined if the person who invites declined, and other errors if the connection fails, the admin breaks the protocol, or the space cannot be taken.