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§
Required Methods§
Sourcefn offer<R: CryptoRng>(
&mut self,
request: &InvitationRequest,
endpoint: &[u8; 32],
rng: &mut R,
) -> Result<Option<Offer>, Self::Error>
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.
Sourcefn grant<R: CryptoRng>(
&mut self,
listing: &str,
rng: &mut R,
) -> Result<InvitationGrant, Self::Error>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".