Struct r34_api::Request

source ·
pub struct Request {
    pub api_url: String,
    pub req_limit: usize,
    pub tags: Vec<&'static str>,
    pub json: bool,
    pub ids: HashMap<String, Option<usize>>,
}

Fields§

§api_url: String

Default API Access URL “https://api.rule34.xxx/index.php?page=dapi&s=post&q=index”

§req_limit: usize

Limitter for max Post per requests. R34s API limmits to max 1000 Posts per request. Default Setting is 1000.

§tags: Vec<&'static str>

All R34 tags should work when exactly taken over. Default is empty.

§json: bool

Json Formatted or not Json Formatted: Default is true.

§ids: HashMap<String, Option<usize>>

Hashmap with the three IDs: ID: Filter for ID of Post. (Recommended to use alone)! PID: Filter for Page ID. CID: Filter for Change ID (Not Recomended)! By Default all are empty.

Implementations§

source§

impl Request

source

pub fn new() -> Request

Creates a new Request by default settings

source

pub fn set_limit(self, limit: usize) -> Self

Sets the limit Filter for the request

source

pub fn add_tag(self, tag: &'static str) -> Self

Adds a Tag to the request

source

pub fn add_tags(self, tags: Vec<&'static str>) -> Self

source

pub fn set_cid(self, cid: usize) -> Self

sets the CID of the request

source

pub fn set_pid(self, pid: usize) -> Self

Sets the PID of the Request

source

pub fn set_id(self, id: usize) -> Self

Sets the Post ID of the Request

source

pub fn set_json_formatted(self, json: bool) -> Self

Activates a Json Formatted Request

source

pub fn to_req_url(&mut self) -> String

Returns the Final Request URL as a String

Trait Implementations§

source§

impl Default for Request

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.