pub struct PairingCode(/* private fields */);Expand description
A code that pairs two replicas once: eight decimal digits, the first two from 10 to 99,
which find the sponsor on the network, and six more that are secret. It is shown as
37-482-177, and never printed in full by Debug.
Implementations§
Source§impl PairingCode
impl PairingCode
Sourcepub fn generate(rng: &mut impl CryptoRng) -> PairingCode
pub fn generate(rng: &mut impl CryptoRng) -> PairingCode
A new random code.
Sourcepub fn nameplate(&self) -> u8
pub fn nameplate(&self) -> u8
The code’s first two digits, from 10 to 99, which find the sponsor.
Sourcepub fn announcement(&self) -> String
pub fn announcement(&self) -> String
What the sponsor announces on the network while it pairs with this code.
Sourcepub fn invitation_announcement(&self) -> String
pub fn invitation_announcement(&self) -> String
What an admin announces on the network while it invites someone with this code.
Trait Implementations§
Source§impl Clone for PairingCode
impl Clone for PairingCode
Source§fn clone(&self) -> PairingCode
fn clone(&self) -> PairingCode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PairingCode
impl Debug for PairingCode
Source§impl Display for PairingCode
impl Display for PairingCode
impl Eq for PairingCode
Source§impl FromStr for PairingCode
impl FromStr for PairingCode
Source§impl PartialEq for PairingCode
impl PartialEq for PairingCode
impl StructuralPartialEq for PairingCode
Auto Trait Implementations§
impl Forget for PairingCode
impl Freeze for PairingCode
impl Move for PairingCode
impl RefUnwindSafe for PairingCode
impl Send for PairingCode
impl Sync for PairingCode
impl Unpin for PairingCode
impl UnsafeUnpin for PairingCode
impl UnwindSafe for PairingCode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.