Skip to main content

RequestBuilder

Struct RequestBuilder 

Source
pub struct RequestBuilder { /* private fields */ }
Expand description

API HTTP Request

A low-level request builder for API integration decoupled from any specific underlying HTTP library.

Implementations§

Source§

impl RequestBuilder

Source

pub fn new(method: Method, path: &str) -> Self

Creates a new request builder with method and path

Source

pub fn params<'a>( self, params: impl IntoIterator<Item = (&'a str, &'a str)>, ) -> Self

Append params to the request’s query string. Parameters may share the same key, and will result in a query string with one or more duplicated query parameter keys.

Source

pub fn payload(self, payload: &str) -> Self

Sets the request body payload

Source

pub fn credentials(self, credentials: Credentials) -> Self

Sets the API credentials for authentication

Source

pub fn x_gate_exp_time(self, x_gate_exp_time: u128) -> Self

Sets the Gate expiration time

Source

pub fn sign(self) -> Self

Marks this request to be signed with HMAC

Trait Implementations§

Source§

impl From<RequestBuilder> for Request

Source§

fn from(builder: RequestBuilder) -> Request

Converts to this type from the input type.

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.