Skip to main content

Inviting

Trait Inviting 

Source
pub trait Inviting {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn offer<R: CryptoRng>(
        &mut self,
        request: &InvitationRequest,
        endpoint: &[u8; 32],
        rng: &mut R,
    ) -> Result<Option<Offer>, Self::Error>;
    fn grant<R: CryptoRng>(
        &mut self,
        listing: &str,
        rng: &mut R,
    ) -> Result<InvitationGrant, Self::Error>;
    fn record<R: CryptoRng>(&mut self, rng: &mut R) -> Result<(), Self::Error>;
}
Expand description

The admin’s side of an invitation: what it offers the one who asks, once the person confirms, what it grants once the joiner signed its listing, and how it records the new member.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Why offering, granting or recording failed.

Required Methods§

Source

fn offer<R: CryptoRng>( &mut self, request: &InvitationRequest, endpoint: &[u8; 32], rng: &mut R, ) -> Result<Option<Offer>, Self::Error>

What to offer the joiner that request names, connected from endpoint, once the person confirms who asks; None if they decline. Nothing is recorded yet.

§Errors

Returns an error if the library cannot be read.

Source

fn grant<R: CryptoRng>( &mut self, listing: &str, rng: &mut R, ) -> Result<InvitationGrant, Self::Error>

What to grant the joiner whose key signed listing, its listing in the space as the offer said, as text.

§Errors

Returns an error if the listing is not the joiner’s as the request and the offer say, or the library cannot be read.

Source

fn record<R: CryptoRng>(&mut self, rng: &mut R) -> Result<(), Self::Error>

Records the new member and its replica, now that the joiner holds the space.

§Errors

Returns an error if they cannot be recorded.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§