Request

Struct Request 

Source
pub struct Request<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Request<'a>

Source

pub fn new(url: &'a str) -> Self

Source

pub fn with_logging(self, logging: bool) -> Self

Source

pub fn with_method(self, method: Method) -> Self

Source

pub fn with_header(self, name: &'static str, value: impl ToSmolStr) -> Self

Source

pub fn with_headers(self, headers: Option<Vec<(&'static str, SmolStr)>>) -> Self

Source

pub fn with_media_type(self, media_type: MediaType) -> Self

Source

pub fn with_body(self, body: Vec<u8>) -> Self

Source

pub fn with_file(self, file: File) -> Self

Source

pub fn with_is_load(self, is_load: bool) -> Self

Source

pub fn with_timeout(self, timeout: Option<Duration>) -> Self

Source

pub fn encoding(self, media_type: impl Into<MediaType>) -> Self

Source

pub fn encoding_with_response(self, media_type: impl Into<MediaType>) -> Self

Source

pub fn json(self) -> Self

Source

pub fn json_with_response(self) -> Self

Source

pub fn postcard(self) -> Self

Source

pub fn postcard_with_response(self) -> Self

Source

pub fn create(self) -> Self

Source

pub fn retrieve(self) -> Self

Source

pub fn update(self) -> Self

Source

pub fn delete(self) -> Self

Source

pub fn execute(self) -> Self

Source

pub fn logging(&self) -> bool

Source

pub fn method(&self) -> &Method

Source

pub fn is_load(&self) -> bool

Source

pub fn url(&self) -> &str

Source

pub fn media_type(&self) -> Option<MediaType>

Source

pub fn headers(&self) -> Option<&[(&'static str, SmolStr)]>

Source

pub fn wants_response(&self) -> bool

Trait Implementations§

Source§

impl TryFrom<&Request<'_>> for Headers

Source§

type Error = SmolStr

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

fn try_from(request: &Request<'_>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'a> Freeze for Request<'a>

§

impl<'a> RefUnwindSafe for Request<'a>

§

impl<'a> Send for Request<'a>

§

impl<'a> Sync for Request<'a>

§

impl<'a> Unpin for Request<'a>

§

impl<'a> UnwindSafe for Request<'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.