pub struct Sponsor<'a> { /* private fields */ }Expand description
The library as pairing changes it: what grants a new replica the space keys, and records it once it has joined.
Implementations§
Source§impl<'a> Sponsor<'a>
impl<'a> Sponsor<'a>
Sourcepub fn new(library: &'a mut Library, now: &'a dyn Fn() -> u64) -> Self
pub fn new(library: &'a mut Library, now: &'a dyn Fn() -> u64) -> Self
Pairing of library, with the wall clock now.
Sourcepub fn for_device(self, device: NewDevice) -> Self
pub fn for_device(self, device: NewDevice) -> Self
The same, pairing a device of the person’s as they chose: a computer, which takes every space of this device’s, or the spaces chosen, and those given to it later; or a phone, which takes the personal space alone, or the spaces chosen, and asks before it takes a space given to it later (technical design).
Sourcepub fn giving_secrets(self) -> Self
pub fn giving_secrets(self) -> Self
The same, giving the secrets, which are unlocked, to a new replica that asks for them: the person chose to.
Sourcepub const fn matched(&self) -> bool
pub const fn matched(&self) -> bool
Whether the code matched: a joiner was granted, or would have been, had granting not failed. A pairing that failed before then leaves the code for another try.
Trait Implementations§
Source§impl Sponsoring for Sponsor<'_>
impl Sponsoring for Sponsor<'_>
Source§fn grant<R: CryptoRng>(
&mut self,
request: &JoinRequest,
endpoint: &[u8; 32],
rng: &mut R,
) -> Result<Grant, NodeError>
fn grant<R: CryptoRng>( &mut self, request: &JoinRequest, endpoint: &[u8; 32], rng: &mut R, ) -> Result<Grant, NodeError>
What to grant the replica that
request asks for, connected from endpoint, with
the space keys sealed to it. Nothing is recorded yet. Read moreSource§fn record<R: CryptoRng>(
&mut self,
listings: &[String],
rng: &mut R,
) -> Result<(), NodeError>
fn record<R: CryptoRng>( &mut self, listings: &[String], rng: &mut R, ) -> Result<(), NodeError>
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. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Sponsor<'a>
impl<'a> !Send for Sponsor<'a>
impl<'a> !Sync for Sponsor<'a>
impl<'a> !UnwindSafe for Sponsor<'a>
impl<'a> Forget for Sponsor<'a>
impl<'a> Freeze for Sponsor<'a>
impl<'a> Move for Sponsor<'a>
impl<'a> Unpin for Sponsor<'a>
impl<'a> UnsafeUnpin for Sponsor<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more