[−][src]Struct oauth1_request::Builder
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]
&mut self,
timestamp: impl Into<Option<NonZeroU64>>
) -> &mut Self
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
&self,
method: &str,
uri: U,
request: &R
) -> String where
SM: Clone,
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]
self,
method: &str,
uri: U,
request: &R
) -> String
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,
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,
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,
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,
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,
C: UnwindSafe,
SM: UnwindSafe,
T: UnwindSafe,
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, 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>,