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

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

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.

Show fields

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.