pub struct Token { /* private fields */ }Expand description
A waggle token: inline, Copy, 24 bytes total.
Tokens are names, not data — comparison, hashing, and display are the
whole interface. Construction is either Token::parse (validated) or
Token::generate (rejection-sampled from an Entropy source).
Implementations§
Source§impl Token
impl Token
Sourcepub fn parse(s: &str) -> Result<Self, TokenError>
pub fn parse(s: &str) -> Result<Self, TokenError>
Parse and validate an existing token string.
Trait Implementations§
impl Copy for Token
Source§impl<'de> Deserialize<'de> for Token
impl<'de> Deserialize<'de> for Token
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Token
Source§impl Ord for Token
impl Ord for Token
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Lexicographic by string form — deterministic map ordering is what R-1’s byte-identical serialization rests on.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Token
impl PartialOrd for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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