pub struct Authorizer<'a, SM: SignatureMethod, W = String> { /* private fields */ }
Expand description

A Serializer that signs a request and produces OAuth 1.0 oauth_* parameter values.

The resulting parameter values are either written to an HTTP Authorization header value or URI query/x-www-form-urlencoded string (along with the other request parameters) depending on the constructor you use.

Implementations

Available on crate feature alloc only.

Creates an Authorizer that produces an HTTP `Authorization header value.

uri must not contain a query part. Otherwise, the serializer will produce a wrong signature.

Panics

In debug builds, panics if uri contains a '?' character.

Available on crate feature alloc only.

Creates an Authorizer that produces an x-www-form-urlencoded string.

uri must not contain a query part. Otherwise, the serializer will produce a wrong signature.

Panics

In debug builds, panics if uri contains a '?' character.

Creates an Authorizer that appends a query part to uri.

uri must not contain a query part. Otherwise, the serializer will produce a wrong signature.

Panics

In debug builds, panics if uri contains a '?' character.

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

Same with form except that this writes the resulting form 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

The type of the value produced by this serializer.

Serializes a key-value pair. Read more

Serializes a key-value pair. Read more

Appends oauth_callback parameter to the Authorization header. Read more

Appends oauth_consumer_key parameter to the Authorization header. Read more

Appends oauth_nonce parameter to the Authorization header. Read more

Appends oauth_signature_method parameter to the Authorization header. Read more

Appends oauth_timestamp parameter to the Authorization header. Read more

Appends oauth_token parameter to the Authorization header. Read more

Appends oauth_verifier parameter to the Authorization header. Read more

Appends oauth_version parameter to the Authorization header. Read more

Finalizes the serialization and returns the serialized value.

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

Appends all oauth_* parameter to the Authorization header.

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.