Skip to main content

Sponsoring

Trait Sponsoring 

Source
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§

Source

type Error: Error + Send + Sync + 'static

Why granting or recording the replica failed.

Required Methods§

Source

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.

Source

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".

Implementors§