pub trait Sponsoring {
type Error: Error + Send + Sync + 'static;
// Required methods
fn grant<R: CryptoRng>(
&mut self,
request: &JoinRequest,
endpoint: &[u8; 32],
rng: &mut R,
) -> Result<Grant, Self::Error>;
fn record<R: CryptoRng>(
&mut self,
listings: &[String],
rng: &mut R,
) -> Result<(), Self::Error>;
}Expand description
The library’s side of pairing: what grants a new replica the space keys, and records it once it has joined.
Required Associated Types§
Required Methods§
Sourcefn grant<R: CryptoRng>(
&mut self,
request: &JoinRequest,
endpoint: &[u8; 32],
rng: &mut R,
) -> Result<Grant, Self::Error>
fn grant<R: CryptoRng>( &mut self, request: &JoinRequest, endpoint: &[u8; 32], rng: &mut R, ) -> Result<Grant, Self::Error>
What to grant the replica that request asks for, connected from endpoint, with
the space keys sealed to it. Nothing is recorded yet.
§Errors
Returns an error if the library cannot be read or written.
Sourcefn record<R: CryptoRng>(
&mut self,
listings: &[String],
rng: &mut R,
) -> Result<(), Self::Error>
fn record<R: CryptoRng>( &mut self, listings: &[String], rng: &mut R, ) -> Result<(), Self::Error>
Records the replica that the last grant named, now that it has made its library, with the listings that its key signed: in the personal space first, then, for an AI agent’s replica, in each space that the grant chose for it.
§Errors
Returns an error if the replica cannot be recorded, or a listing is not the one the grant asked for.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".