Struct egg_mode::auth::KeyPair[][src]

pub struct KeyPair {
    pub key: Cow<'static, str>,
    pub secret: Cow<'static, str>,
}
Expand description

A key/secret pair representing the app that is sending a request or an authorization from a user.

This type is used as part of the authentication process and to sign API requests afterward. For the most part it’s used internally as part of a Token, but at the very beginning of the authentication process, you’ll need to manually create one to hold onto your “consumer token” and request a request token.

For more information, see the authentication documentation.

Example

let con_token = egg_mode::KeyPair::new("consumer key", "consumer token");

Fields

key: Cow<'static, str>

A key used to identify an application or user.

secret: Cow<'static, str>

A private key used to sign messages from an application or user.

Implementations

Creates a KeyPair with the given key and secret.

This can be called with either &'static str (a string literal) or String for either parameter.

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.