[−][src]Struct reqwest_oauth1::Secrets
Represents OAuth secrets including consumer_key, consumer_secret, token, and token_secret. The token and token_secret are optional.
Basic usage
use reqwest_oauth1::OAuthClientProvider; let consumer_key = "[CONSUMER_KEY]"; let consumer_secret = "[CONSUMER_SECRET]"; // if you don't have the token and token secret: let secrets = reqwest_oauth1::Secrets::new(consumer_key, consumer_secret); // when you have the access token and secret: let access_token = "[ACCESS_TOKEN]"; let token_secret = "[TOKEN_SECRET]"; let secrets_with_token = secrets.token(access_token, token_secret); // use the secret let req = reqwest::Client::new() .oauth1(secrets_with_token) .post("http://example.com/");
Implementations
impl<'a> Secrets<'a>
[src]
pub fn new<TKey, TSecret>(consumer_key: TKey, consumer_secret: TSecret) -> Self where
TKey: Into<Cow<'a, str>>,
TSecret: Into<Cow<'a, str>>,
[src]
TKey: Into<Cow<'a, str>>,
TSecret: Into<Cow<'a, str>>,
pub fn new_with_token<TKey, TSecret, TToken, TTokenSecret>(
consumer_key: TKey,
consumer_secret: TSecret,
token: TToken,
token_secret: TTokenSecret
) -> Self where
TKey: Into<Cow<'a, str>>,
TSecret: Into<Cow<'a, str>>,
TToken: Into<Cow<'a, str>>,
TTokenSecret: Into<Cow<'a, str>>,
[src]
consumer_key: TKey,
consumer_secret: TSecret,
token: TToken,
token_secret: TTokenSecret
) -> Self where
TKey: Into<Cow<'a, str>>,
TSecret: Into<Cow<'a, str>>,
TToken: Into<Cow<'a, str>>,
TTokenSecret: Into<Cow<'a, str>>,
pub fn token<TKey, TSecret>(
self,
token: TKey,
token_secret: TSecret
) -> Secrets<'a> where
TKey: Into<Cow<'a, str>>,
TSecret: Into<Cow<'a, str>>,
[src]
self,
token: TKey,
token_secret: TSecret
) -> Secrets<'a> where
TKey: Into<Cow<'a, str>>,
TSecret: Into<Cow<'a, str>>,
Trait Implementations
impl<'a> Clone for Secrets<'a>
[src]
impl<'a> Debug for Secrets<'a>
[src]
impl<'_> SecretsProvider for Secrets<'_>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Secrets<'a>
impl<'a> Send for Secrets<'a>
impl<'a> Sync for Secrets<'a>
impl<'a> Unpin for Secrets<'a>
impl<'a> UnwindSafe for Secrets<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,