pub struct UserCode(/* private fields */);Expand description
A device-flow user code: the responder issues it, the joiner shows it, and the operator
enters it at the responder to approve. Debug does not show it.
Implementations§
Source§impl UserCode
impl UserCode
Sourcepub fn generate(alphabet: &CodeAlphabet, random: &Random) -> Result<Self, Error>
pub fn generate(alphabet: &CodeAlphabet, random: &Random) -> Result<Self, Error>
A random user code of alphabet.
§Errors
Error::InvalidOptions for a meaningless alphabet, Error::Random.
Sourcepub fn parse(alphabet: &CodeAlphabet, text: &str) -> Result<Self, Error>
pub fn parse(alphabet: &CodeAlphabet, text: &str) -> Result<Self, Error>
text as a user code of alphabet, matched exactly.
§Errors
Error::InvalidCode when it is not exactly len characters of the alphabet.
Trait Implementations§
impl Eq for UserCode
impl StructuralPartialEq for UserCode
Auto Trait Implementations§
impl Freeze for UserCode
impl RefUnwindSafe for UserCode
impl Send for UserCode
impl Sync for UserCode
impl Unpin for UserCode
impl UnsafeUnpin for UserCode
impl UnwindSafe for UserCode
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