[][src]Struct oauth1_request::Builder

pub struct Builder<'a, SM, C = String, T = C> { /* fields omitted */ }

A builder for OAuth Authorization header string.

Implementations

impl<'a, SM: SignatureMethod, C: Borrow<str>, T: Borrow<str>> Builder<'a, SM, C, T>[src]

pub fn new(client: Credentials<C>, signature_method: SM) -> Self[src]

Creates a Builder that signs requests using the specified client credentials and signature method.

pub fn with_token(token: Token<C, T>, signature_method: SM) -> Self[src]

Creates a Builder that uses the token credentials from token.

pub fn token(&mut self, token: impl Into<Option<Credentials<T>>>) -> &mut Self[src]

Sets/unsets the token credentials pair to sign requests with.

pub fn callback(&mut self, callback: impl Into<Option<&'a str>>) -> &mut Self[src]

Sets/unsets the oauth_callback URI.

pub fn verifier(&mut self, verifier: impl Into<Option<&'a str>>) -> &mut Self[src]

Sets/unsets the oauth_verifier value.

pub fn nonce(&mut self, nonce: impl Into<Option<&'a str>>) -> &mut Self[src]

Sets/unsets the oauth_nonce value.

By default, Builder generates a random nonce for each request. This method overrides that behavior and forces the Builder to use the specified nonce.

This method is for debugging/testing purpose only and should not be used in production.

pub fn timestamp(
    &mut self,
    timestamp: impl Into<Option<NonZeroU64>>
) -> &mut Self
[src]

Sets/unsets the oauth_timestamp value.

By default, Builder uses the timestamp of the time when build(-like) method is called. This method overrides that behavior and forces the Builder to use the specified timestamp.

This method is for debugging/testing purpose only and should not be used in production.

pub fn version(&mut self, version: bool) -> &mut Self[src]

Sets whether to include the oauth_version value in requests.

pub fn get<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a GET request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn put<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a PUT request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn post<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a POST request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn delete<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a DELETE request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn options<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes an OPTIONS request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn head<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a HEAD request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn connect<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a CONNECT request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn patch<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a PATCH request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn trace<U: Display, R: Request + ?Sized>(
    &self,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a TRACE request to uri.

uri must not contain a query part, which would result in a wrong signature.

pub fn build<U: Display, R: Request + ?Sized>(
    &self,
    method: &str,
    uri: U,
    request: &R
) -> String where
    SM: Clone
[src]

Authorizes a request to uri with a custom HTTP request method.

uri must not contain a query part, which would result in a wrong signature.

pub fn consume<U: Display, R: Request + ?Sized>(
    self,
    method: &str,
    uri: U,
    request: &R
) -> String
[src]

Authorizes a request and consumes self.

This may be more efficient than build if the signature method holds a non-Copy data (e.g. RSA private key). However, the cost is the same as build for the signature methods bundled with this library (HmacSha1 and Plaintext).

Trait Implementations

impl<'a, SM: Clone, C: Clone, T: Clone> Clone for Builder<'a, SM, C, T>[src]

impl<'a, SM: Debug, C: Debug, T: Debug> Debug for Builder<'a, SM, C, T>[src]

Auto Trait Implementations

impl<'a, SM, C, T> RefUnwindSafe for Builder<'a, SM, C, T> where
    C: RefUnwindSafe,
    SM: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, SM, C, T> Send for Builder<'a, SM, C, T> where
    C: Send,
    SM: Send,
    T: Send

impl<'a, SM, C, T> Sync for Builder<'a, SM, C, T> where
    C: Sync,
    SM: Sync,
    T: Sync

impl<'a, SM, C, T> Unpin for Builder<'a, SM, C, T> where
    C: Unpin,
    SM: Unpin,
    T: Unpin

impl<'a, SM, C, T> UnwindSafe for Builder<'a, SM, C, T> where
    C: UnwindSafe,
    SM: UnwindSafe,
    T: UnwindSafe

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> 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>,