[][src]Struct pixieve_rs::pixiv::request::PixivRequest

pub struct PixivRequest {
    pub method: Method,
    pub url: Uri,
    pub headers: HeaderMap,
    pub params: HashMap<&'static str, String>,
    pub form: HashMap<&'static str, String>,
}

PixivClient request. You can create this using PixivRequestBuilder::build. This is for if you wish to inspect the request before sending.

Fields

method: Methodurl: Uriheaders: HeaderMapparams: HashMap<&'static str, String>form: HashMap<&'static str, String>

Implementations

impl PixivRequest[src]

TODO: Consider replacing all the variations of adding stuff to a Trait

pub fn new(method: Method, url: Uri) -> PixivRequest[src]

Create a new PixivRequest. A PixivRequest is returned when calling build() on PixivRequestBuilder, so it is recommended you use that instead.

pub fn add_header<T, U>(self, key: T, val: U) -> Self where
    T: Into<HeaderName>,
    U: Into<HeaderValue>, 
[src]

Add header to the request

pub fn add_header_str<'a, T>(self, key: T, val: &'a str) -> Self where
    T: Into<HeaderName>, 
[src]

Add header to the request TODO: Propagate this error.

pub fn add_param<U>(self, key: &'static str, val: U) -> Self where
    U: Into<String>, 
[src]

Add header to the request

pub fn maybe_add_param<U>(self, key: &'static str, val: Option<U>) -> Self where
    U: Into<String>, 
[src]

Add header to the request

pub fn add_param_from_str(self, key: &'static str, val: &'static str) -> Self[src]

Add header to the request TODO: Propagate this error.

pub fn add_form<T>(self, key: &'static str, val: T) -> Self where
    T: Into<String>, 
[src]

Add form data to the request

pub fn add_form_from_str(self, key: &'static str, val: &'static str) -> Self[src]

Add form data to the request

pub fn finish(self) -> Self[src]

TODO: Propagate this error. TODO: This should return the actual Request and called from a Builder. Sets query using serde_urlencoded

Trait Implementations

impl Clone for PixivRequest[src]

impl Debug for PixivRequest[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

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