[][src]Enum egg_mode::auth::Token

pub enum Token {
    Access {
        consumer: KeyPair,
        access: KeyPair,
    },
    Bearer(String),
}

A token that can be used to sign requests to Twitter.

Conceptually, a Token represents your authorization to call the Twitter API. It can either be a Bearer token, representing a "logged-out" view of Twitter coming from your app itself; or an Access token, representing a combination of your app's "consumer" key with a specific user granting access for your app to use the Twitter API on their behalf. For more information, see the authentication documentation.

Once you have obtained a Token of either kind, the keys within may be saved and reused in the future, as long as the access has not been revoked. Note that the keys saved in this type work just like a password, and they should be handled with care when you save them! If you believe your keys have been compromised, you can generate a new consumer token in Twitter's Apps Dashboard, and if you've been using a Bearer token, you should invalidate it and generate a new one.

Variants

Access

An OAuth Access token indicating the request is coming from a specific user.

Fields of Access

consumer: KeyPair

A "consumer" key/secret that represents the application sending the request.

access: KeyPair

An "access" key/secret that represents the user's authorization of the application.

Bearer(String)

An OAuth Bearer token indicating the request is coming from the application itself, not a particular user.

Trait Implementations

impl Clone for Token[src]

impl Debug for Token[src]

impl<'de> Deserialize<'de> for Token[src]

impl Serialize for Token[src]

Auto Trait Implementations

impl RefUnwindSafe for Token

impl Send for Token

impl Sync for Token

impl Unpin for Token

impl UnwindSafe for Token

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,