pub struct Joining<'a> { /* private fields */ }Expand description
A new replica that is joining a library: its keys, and the names of its device and app, before the sponsor grants it the space keys.
Implementations§
Source§impl<'a> Joining<'a>
impl<'a> Joining<'a>
Sourcepub fn new(
device: &str,
app: &str,
rng: &mut impl CryptoRng,
) -> Result<Self, NodeError>
pub fn new( device: &str, app: &str, rng: &mut impl CryptoRng, ) -> Result<Self, NodeError>
A new replica on a device, kept by an app, with new keys.
§Errors
Returns NodeError::EmptyName if a name is empty.
Sourcepub fn asking_for_secrets(
self,
protection: NewProtection<'a>,
rng: &mut impl CryptoRng,
) -> Self
pub fn asking_for_secrets( self, protection: NewProtection<'a>, rng: &mut impl CryptoRng, ) -> Self
Asks the sponsor for the secrets too, with a new secrets key, which the new library
keeps in a secrets compartment protected as protection says, never by the library’s
passphrase: the sponsor gives them, if it holds them and the person chose to there.
After its first sync, the new replica states that it asks the sponsor, with that key,
and takes what was given; if the sponsor held none, the compartment is removed again.
Sourcepub fn request(&self) -> JoinRequest
pub fn request(&self) -> JoinRequest
What it asks the sponsor for.
Sourcepub fn network(&self, options: Options) -> Result<Network, NodeError>
pub fn network(&self, options: Options) -> Result<Network, NodeError>
Starts the new replica’s endpoint, as Library::network does.
§Errors
Returns an error if networking cannot start.
Sourcepub fn make(
self,
directory: &Path,
grant: &Grant,
protection: &NewProtection<'_>,
rng: &mut impl CryptoRng,
) -> Result<Library, NodeError>
pub fn make( self, directory: &Path, grant: &Grant, protection: &NewProtection<'_>, rng: &mut impl CryptoRng, ) -> Result<Library, NodeError>
Makes the library in a directory that holds none, from what the sponsor granted:
the new replica’s keys, protected as protection says, with the space keys, and the
library file. Its spaces are empty until it syncs. If making it fails, what was
written is removed, keystore keys included.
§Errors
Returns an error if the directory holds a library already, the grant’s keys do not open or lack the personal space, or the files cannot be written.