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

A builder for OAuth Authorization header string.

Implementations

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

Creates a Builder that uses the token credentials from token.

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

Sets/unsets the oauth_callback URI.

Sets/unsets the oauth_verifier value.

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.

Sets/unsets the oauth_timestamp value.

By default, Builder uses the timestamp of the time when authorize-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.

Sets whether to include the oauth_version value in requests.

Available on crate feature alloc only.

Authorizes a GET request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a PUT request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a POST request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a DELETE request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a OPTIONS request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a HEAD request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a CONNECT request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a PATCH request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a TRACE request to uri, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a PUT request to uri, writing the OAuth protocol parameters to an x-www-form-urlencoded string along with the other request parameters.

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

Available on crate feature alloc only.

Authorizes a POST request to uri, writing the OAuth protocol parameters to an x-www-form-urlencoded string along with the other request parameters.

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

Available on crate feature alloc only.

Authorizes a OPTIONS request to uri, writing the OAuth protocol parameters to an x-www-form-urlencoded string along with the other request parameters.

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

Available on crate feature alloc only.

Authorizes a PATCH request to uri, writing the OAuth protocol parameters to an x-www-form-urlencoded string along with the other request parameters.

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

Authorizes a GET request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Authorizes a PUT request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Authorizes a POST request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Authorizes a DELETE request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Authorizes a OPTIONS request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Authorizes a HEAD request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Authorizes a CONNECT request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Authorizes a PATCH request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Authorizes a TRACE request to uri, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Available on crate feature alloc only.

Authorizes a request to uri with a custom HTTP request method, returning an HTTP Authorization header value.

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

Available on crate feature alloc only.

Authorizes a request to uri with a custom HTTP request method, writing the OAuth protocol parameters to an x-www-form-urlencoded string along with the other request parameters.

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

Authorizes a request to uri with a custom HTTP request method, appending the OAuth protocol parameters to uri along with the other request parameters.

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

Same as authorize except that this writes the resulting Authorization header value into buf.

Available on crate feature alloc only.

Same as to_form except that this writes the resulting x-www-form-urlencoded string into buf.

Available on crate feature alloc only.

Authorizes a request and consumes self, returning an HTTP Authorization header value.

Unlike authorize, this does not clone the signature method and may be more efficient for non-Copy signature methods like RsaSha1.

For HmacSha1, &RsaSha1 and Plaintext, cloning is no-op or very cheap so you should use authorize instead.

Available on crate feature alloc only.

Authorizes a request and consumes self, writing the OAuth protocol parameters to an x-www-form-urlencoded string along with the other request parameters.

Unlike to_form, this does not clone the signature method and may be more efficient for non-Copy signature methods like RsaSha1.

For HmacSha1, &RsaSha1 and Plaintext, cloning is no-op or very cheap so you should use to_form instead.

Authorizes a request and consumes self, appending the OAuth protocol parameters to uri along with the other request parameters.

Unlike to_query, this does not clone the signature method and may be more efficient for non-Copy signature methods like RsaSha1.

For HmacSha1, &RsaSha1 and Plaintext, cloning is no-op or very cheap so you should use to_query instead.

Same as into_authorization except that this writes the resulting Authorization header value into buf.

Same as into_form except that this writes the resulting x-www-form-urlencoded string into buf.

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

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

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

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.