pub struct PairingCode(/* private fields */);Expand description
A one-time pairing code: 32 random bytes the device made, shown only in
its QR code. Compared in constant time; fmt::Debug does not show
it.
Implementations§
Source§impl PairingCode
impl PairingCode
pub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn as_bytes(&self) -> &[u8; 32]
Sourcepub fn matches(&self, other: &PairingCode) -> bool
pub fn matches(&self, other: &PairingCode) -> bool
Whether other is this code, in time that does not depend on
where they differ: every byte is looked at, whatever the first.
Sourcepub fn from_text(text: &str) -> Option<Self>
pub fn from_text(text: &str) -> Option<Self>
The code text writes, as Self::to_text gives it; None if
it is not one.
Trait Implementations§
Source§impl Clone for PairingCode
impl Clone for PairingCode
impl Copy for PairingCode
Source§impl Debug for PairingCode
impl Debug for PairingCode
Source§impl<'de> Deserialize<'de> for PairingCode
impl<'de> Deserialize<'de> for PairingCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PairingCode
Source§impl Hash for PairingCode
impl Hash for PairingCode
Source§impl PartialEq for PairingCode
impl PartialEq for PairingCode
Source§impl Serialize for PairingCode
impl Serialize for PairingCode
impl StructuralPartialEq for PairingCode
Auto Trait Implementations§
impl Freeze 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