pub struct Request<'a> {
pub body: Option<&'a [u8]>,
pub headers: Option<HeaderMap>,
pub endpoint: String,
pub method: Method,
}Expand description
A struct representing a request to some endpoint.
Fields§
§body: Option<&'a [u8]>The body of the request. (Note that this is rarely, if ever, used in this lib.)
headers: Option<HeaderMap>The headers of the request.
endpoint: StringThe endpoint (e.g. /players/%23sometag).
method: MethodThe method (GET/POST/…). Defaults to GET
Implementations§
Source§impl<'a> Request<'a>
impl<'a> Request<'a>
Sourcepub fn build(&'a self, client: &Client) -> Result<RequestBuilder>
pub fn build(&'a self, client: &Client) -> Result<RequestBuilder>
(For sync usage) Creates a (blocking) RequestBuilder (reqwest crate) instance.
Sourcepub fn a_build(&'a self, client: &Client) -> Result<ARequestBuilder>
pub fn a_build(&'a self, client: &Client) -> Result<ARequestBuilder>
(For async usage) Creates a (non-blocking) RequestBuilder (reqwest crate) instance.
Trait Implementations§
impl<'a> Eq for Request<'a>
impl<'a> StructuralPartialEq for Request<'a>
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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FetchFrom<T> for T
impl<T> FetchFrom<T> for T
Source§fn fetch_from(_: &Client, t: &T) -> Result<T, Error>
fn fetch_from(_: &Client, t: &T) -> Result<T, Error>
(Sync) Returns a copy of the current instance when attempting to fetch from itself.
In order to re-fetch, see Refetchable.
§Errors
Never errors; is only a Result in order to match the trait signature.
Source§fn a_fetch_from<'life0, 'life1, 'async_trait>(
_: &'life0 Client,
t: &'life1 T,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
fn a_fetch_from<'life0, 'life1, 'async_trait>(
_: &'life0 Client,
t: &'life1 T,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
(Async) Returns a copy of the current instance when attempting to fetch from itself.
In order to re-fetch, see Refetchable.
§Errors
Never errors; is only a Result in order to match the trait signature.