AuthorizedHttpRequest

Struct AuthorizedHttpRequest 

Source
pub struct AuthorizedHttpRequest<A: Authorization, R: HttpRequest> { /* private fields */ }
Expand description

Wrapper type that adds authorization information to a request

Implementations§

Source§

impl<A: Authorization, R: HttpRequest> Authorized<A, R>

Source

pub const fn new(authorization: A, request: R) -> Self

Create a new authorized request

Trait Implementations§

Source§

impl<A: Debug + Authorization, R: Debug + HttpRequest> Debug for Authorized<A, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A: Authorization, R: HttpRequest> HttpRequest for Authorized<A, R>

Source§

const METHOD: Method = R::METHOD

The method used to send the data to the API endpoint
Source§

type Response = <R as HttpRequest>::Response

The response type that is expected to the request
Source§

type Query = <R as HttpRequest>::Query

The query type that is sent to the API endpoint
Source§

type Body = <R as HttpRequest>::Body

The body type that is sent to the API endpoint
Source§

fn path(&self) -> String

Get the API endpoint path relative to the base URL
Source§

fn query(&self) -> Option<&Self::Query>

Get query parameters for the http::Request
Source§

fn body(&self) -> Option<&Self::Body>

Get the body for the http::Request
Source§

fn apply_headers(&self, headers: &mut HeaderMap)

Get the headers for the http::Request
Source§

fn read_response(response: Response<Bytes>) -> Result<Self::Response, Error>

Convert the response from a http::Response Read more
Source§

fn to_http_request(&self, base_url: &Url) -> Result<Request<Vec<u8>>, Error>

Build a HTTP request from the request type

Auto Trait Implementations§

§

impl<A, R> Freeze for Authorized<A, R>
where A: Freeze, R: Freeze,

§

impl<A, R> RefUnwindSafe for Authorized<A, R>

§

impl<A, R> Send for Authorized<A, R>
where A: Send, R: Send,

§

impl<A, R> Sync for Authorized<A, R>
where A: Sync, R: Sync,

§

impl<A, R> Unpin for Authorized<A, R>
where A: Unpin, R: Unpin,

§

impl<A, R> UnwindSafe for Authorized<A, R>
where A: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<R> WithAuthorization for R
where R: HttpRequest,

Source§

fn with_authorization<A: Authorization>( self, authorization: A, ) -> AuthorizedHttpRequest<A, Self>

Augment the request with authorization information
Source§

impl<T> ErasedDestructor for T
where T: 'static,