pub struct RelayCode(/* private fields */);Expand description
The short code a device shows beside its QR code, for a root terminal with no camera to pair it through a server both reach: 10 characters of Crockford’s base32, written in two groups of five.
Implementations§
Source§impl RelayCode
impl RelayCode
Sourcepub fn from_random(bytes: [u8; 10]) -> Self
pub fn from_random(bytes: [u8; 10]) -> Self
The code bytes make: each of the first 10 taken mod 32.
Sourcepub fn parse(text: &str) -> Option<Self>
pub fn parse(text: &str) -> Option<Self>
The code a person typed: case, spaces and dashes ignored; I and L
read as 1, O as 0, as Crockford’s base32 reads them. None if it
is not 10 such characters.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RelayCode
impl<'de> Deserialize<'de> for RelayCode
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 RelayCode
impl StructuralPartialEq for RelayCode
Auto Trait Implementations§
impl Forget for RelayCode
impl Freeze for RelayCode
impl Move for RelayCode
impl RefUnwindSafe for RelayCode
impl Send for RelayCode
impl Sync for RelayCode
impl Unpin for RelayCode
impl UnsafeUnpin for RelayCode
impl UnwindSafe for RelayCode
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