Skip to main content

pair_device

Function pair_device 

Source
pub fn pair_device(
    library: &mut Library,
    network: &Network,
    code: &PairingCode,
    (device, give_secrets): (&NewDevice, bool),
    showing: Showing<'_>,
    now: &dyn Fn() -> u64,
    rng: &mut impl CryptoRng,
) -> Result<Paired, NodeError>
Expand description

Pairs a new device of the person’s, as pair does, as they chose: a computer, which gets every space of this device’s, or the spaces chosen, and takes those given to it later; or a phone, which gets the personal space alone, or the spaces chosen, and asks before it takes a space given to it later (technical design). With give_secrets, it gives the new device the secrets, as pair_giving_secrets does.

§Errors

Returns the errors of pair; and, before the code is shown, NodeError::SecretsLocked if the secrets are to be given and are not unlocked, and NodeError::NoSpace or NodeError::NotListed for a space chosen that this device does not hold, or is not listed in.