pub struct Token(/* private fields */);Expand description
Where an instance is: its node and the arguments it came with, its params and counters, and what it waits for. Store it with the instance, and pass it back to resume.
A token holds state, not identity: instances in the same state have equal tokens, so key instances by an id of your own. And it isn’t signed: its checksum catches damage, not tampering. Keep tokens where only the host can change them, like any other state it trusts.
Implementations§
Source§impl Token
impl Token
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Token
pub fn from_bytes(bytes: Vec<u8>) -> Token
A token from the bytes as_bytes gave. It is checked
when used, not here.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
The bytes to store, without copying them.
Sourcepub fn from_base64(text: &str) -> Result<Token, InputError>
pub fn from_base64(text: &str) -> Result<Token, InputError>
A token from the text to_base64 gave. Padding
and the standard alphabet’s + and / are read too.
Sourcepub fn inspect(&self) -> Result<TokenInfo, InputError>
pub fn inspect(&self) -> Result<TokenInfo, InputError>
What the token says, read without a flow.
Trait Implementations§
impl Eq 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
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.