Struct CallRequest

Source
pub struct CallRequest<'a> { /* private fields */ }
Expand description

present a http request

Implementations§

Source§

impl<'a> CallRequest<'a>

Source

pub fn with_header(self, key: &str, value: &str) -> GGRResult<CallRequest<'a>>

adds a specific header to the request

Source

pub fn with_json_body<S: Serialize>( &mut self, body: &S, ) -> GGRResult<&mut CallRequest<'a>>

sets the JSON request body for the request.

Source

pub fn with_form_data(&mut self, form: Form) -> GGRResult<&mut CallRequest<'a>>

attaches some form data to the request.

Source

pub fn follow_location(&mut self, val: bool) -> GGRResult<&mut CallRequest<'a>>

enables or disables redirects. The default is off.

Source

pub fn send_into<W: Write>(self, out: &mut W) -> GGRResult<CallResponse>

Sends the request and writes response data into the given file instead of the response object’s in memory buffer.

Source

pub fn send(self) -> GGRResult<CallResponse>

Sends the request and reads the response body into the response object.

Auto Trait Implementations§

§

impl<'a> Freeze for CallRequest<'a>

§

impl<'a> !RefUnwindSafe for CallRequest<'a>

§

impl<'a> !Send for CallRequest<'a>

§

impl<'a> !Sync for CallRequest<'a>

§

impl<'a> Unpin for CallRequest<'a>

§

impl<'a> !UnwindSafe for CallRequest<'a>

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.