Struct tokenlock::TokenRef
[−]
[src]
pub struct TokenRef(_);
Token that cannot be used to access the contents of a TokenLock
, but can
be used to create a new TokenLock
.
See the module-level documentation for more details.
Examples
The parameter of TokenLock::new
accepts Into<TokenRef>
, so the following
codes are equivalent:
TokenLock::new(&token, 1); TokenLock::new(TokenRef::from(&token), 1);
TokenRef
can be cloned while Token
cannot:
let mut token = Token::new(); let token_ref = TokenRef::from(&token); let lock1 = TokenLock::new(token_ref.clone(), 1); let lock2 = TokenLock::new(token_ref.clone(), 2);
Trait Implementations
impl Debug for TokenRef
[src]
impl PartialEq for TokenRef
[src]
fn eq(&self, __arg_0: &TokenRef) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &TokenRef) -> bool
[src]
This method tests for !=
.
impl Eq for TokenRef
[src]
impl Clone for TokenRef
[src]
fn clone(&self) -> TokenRef
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Hash for TokenRef
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more