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]

[src]

Formats the value using the given formatter.

impl PartialEq for TokenRef
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for TokenRef
[src]

impl Clone for TokenRef
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Hash for TokenRef
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a> From<&'a Token> for TokenRef
[src]

[src]

Performs the conversion.