Struct egg_mode::KeyPair
[−]
[src]
pub struct KeyPair<'a> { pub key: Cow<'a, str>, pub secret: Cow<'a, str>, }
A key/secret pair representing an OAuth token.
This struct is used as part of the authentication process. You'll need to manually create at least one of these, to hold onto your consumer token.
For more information, see the documentation for Tokens.
Example
let con_token = egg_mode::KeyPair::new("consumer key", "consumer token");
Fields
key: Cow<'a, str>
A key used to identify an application or user.
secret: Cow<'a, str>
A private key used to sign messages from an application or user.
Methods
impl<'a> KeyPair<'a>
[src]
fn new<K, S>(key: K, secret: S) -> KeyPair<'a> where
K: Into<Cow<'a, str>>,
S: Into<Cow<'a, str>>,
K: Into<Cow<'a, str>>,
S: Into<Cow<'a, str>>,
Creates a KeyPair with the given key and secret.
This can be called with either &str
or String
. In the former
case the resulting KeyPair will have the same lifetime as the given
reference. If two Strings are given, the KeyPair effectively has
lifetime 'static
.
Trait Implementations
impl<'a> Debug for KeyPair<'a>
[src]
impl<'a> Clone for KeyPair<'a>
[src]
fn clone(&self) -> KeyPair<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more