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§
Source§impl<'a, SM: SignatureMethod> Authorizer<'a, SM>
impl<'a, SM: SignatureMethod> Authorizer<'a, SM>
Available on crate feature alloc
only.
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.
Sourcepub fn form<T: Display>(
method: &str,
uri: T,
client: Credentials<&'a str>,
token: Option<Credentials<&'a str>>,
options: &'a Options<'a>,
signature_method: SM,
) -> Self
Available on crate feature alloc
only.
pub fn form<T: Display>( method: &str, uri: T, client: Credentials<&'a str>, token: Option<Credentials<&'a str>>, options: &'a Options<'a>, signature_method: SM, ) -> Self
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.
Source§impl<'a, SM: SignatureMethod, W: Write> Authorizer<'a, SM, W>
impl<'a, SM: SignatureMethod, W: Write> Authorizer<'a, SM, W>
Sourcepub fn query(
method: &str,
uri: W,
client: Credentials<&'a str>,
token: Option<Credentials<&'a str>>,
options: &'a Options<'a>,
signature_method: SM,
) -> Selfwhere
W: Display,
pub fn query(
method: &str,
uri: W,
client: Credentials<&'a str>,
token: Option<Credentials<&'a str>>,
options: &'a Options<'a>,
signature_method: SM,
) -> Selfwhere
W: Display,
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
.
Sourcepub fn form_with_buf<T: Display>(
buf: W,
method: &str,
uri: T,
client: Credentials<&'a str>,
token: Option<Credentials<&'a str>>,
options: &'a Options<'a>,
signature_method: SM,
) -> Self
pub fn form_with_buf<T: Display>( buf: W, method: &str, uri: T, client: Credentials<&'a str>, token: Option<Credentials<&'a str>>, options: &'a Options<'a>, signature_method: SM, ) -> Self
Same with form
except that this writes the resulting form string into buf
.
Trait Implementations§
Source§impl<'a, SM: Clone + SignatureMethod, W: Clone> Clone for Authorizer<'a, SM, W>
impl<'a, SM: Clone + SignatureMethod, W: Clone> Clone for Authorizer<'a, SM, W>
Source§fn clone(&self) -> Authorizer<'a, SM, W>
fn clone(&self) -> Authorizer<'a, SM, W>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a, SM: Debug + SignatureMethod, W: Debug> Debug for Authorizer<'a, SM, W>
impl<'a, SM: Debug + SignatureMethod, W: Debug> Debug for Authorizer<'a, SM, W>
Source§impl<'a, SM: SignatureMethod, W: Write> Serializer for Authorizer<'a, SM, W>
impl<'a, SM: SignatureMethod, W: Write> Serializer for Authorizer<'a, SM, W>
Source§fn serialize_parameter<V: Display>(&mut self, key: &str, value: V)
fn serialize_parameter<V: Display>(&mut self, key: &str, value: V)
Source§fn serialize_parameter_encoded<V: Display>(&mut self, key: &str, value: V)
fn serialize_parameter_encoded<V: Display>(&mut self, key: &str, value: V)
Source§fn serialize_oauth_callback(&mut self)
fn serialize_oauth_callback(&mut self)
Source§fn serialize_oauth_consumer_key(&mut self)
fn serialize_oauth_consumer_key(&mut self)
Source§fn serialize_oauth_nonce(&mut self)
fn serialize_oauth_nonce(&mut self)
Source§fn serialize_oauth_signature_method(&mut self)
fn serialize_oauth_signature_method(&mut self)
Source§fn serialize_oauth_timestamp(&mut self)
fn serialize_oauth_timestamp(&mut self)
Source§fn serialize_oauth_token(&mut self)
fn serialize_oauth_token(&mut self)
Source§fn serialize_oauth_verifier(&mut self)
fn serialize_oauth_verifier(&mut self)
Source§fn serialize_oauth_version(&mut self)
fn serialize_oauth_version(&mut self)
Auto Trait Implementations§
impl<'a, SM, W> Freeze for Authorizer<'a, SM, W>
impl<'a, SM, W> RefUnwindSafe for Authorizer<'a, SM, W>
impl<'a, SM, W> Send for Authorizer<'a, SM, W>
impl<'a, SM, W> Sync for Authorizer<'a, SM, W>
impl<'a, SM, W> Unpin for Authorizer<'a, SM, W>
impl<'a, SM, W> UnwindSafe for Authorizer<'a, SM, W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> SerializerExt for Swhere
S: Serializer,
impl<S> SerializerExt for Swhere
S: Serializer,
Source§fn serialize_oauth_parameters(&mut self)
fn serialize_oauth_parameters(&mut self)
oauth_*
parameter to the Authorization
header.