pub struct MangaDexClient {
    pub(crate) http_client: HttpClientRef,
}
Expand description

API client to make requests to the MangaDex v5 API.

Fields

http_client: HttpClientRef

Implementations

Create a new MangaDexClient with a custom reqwest::Client.

Examples
use reqwest::Client;

use mangadex_api::v5::MangaDexClient;

let reqwest_client = Client::builder()
    .timeout(std::time::Duration::from_secs(10))
    .build()?;

let client = MangaDexClient::new(reqwest_client);

Create a new MangaDexClient with a custom HttpClient.

In most cases, providing a custom HttpClient isn’t necessary. This function is primarily useful for mock testing but is available for anyone that needs to change the base URL if it changes due to an unforeseen event.

Examples
use reqwest::Client;
use url::Url;

use mangadex_api::v5::MangaDexClient;
use mangadex_api::HttpClient;

let reqwest_client = Client::builder()
    .timeout(std::time::Duration::from_secs(10))
    .build()?;

let http_client = HttpClient::builder()
    .client(reqwest_client)
    .base_url(Url::parse("127.0.0.1:8080")?)
    .build()?;

let client = MangaDexClient::new_with_http_client(http_client);

Return the Reqwest Client.

This can be used to create manual HTTP requests.

Using this is generally not advised as it can provide mutable access to the HttpClient.

Get a builder for handling the account endpoints.

https://api.mangadex.org/swagger.html#/Account

Get a builder for handling the At-Home endpoints.

https://api.mangadex.org/swagger.html#/AtHome

Get a builder for handling the authentication endpoints.

https://api.mangadex.org/swagger.html#/Auth

Get a builder for handling the author endpoints.

https://api.mangadex.org/swagger.html#/Author

Get a builder for handling the captcha endpoints.

https://api.mangadex.org/swagger.html#/Captcha

Get a builder for handling the chapter endpoints.

https://api.mangadex.org/swagger.html#/Chapter

Get a builder for handling manga volume cover art endpoints.

https://api.mangadex.org/swagger.html#/Cover

Get a builder for handling the custom list endpoints.

https://api.mangadex.org/swagger.html#/CustomList

Get a builder for handling the feed endpoints.

https://api.mangadex.org/swagger.html#/Feed

Get a builder for handling the infrastructure endpoints.

https://api.mangadex.org/swagger.html#/Infrastructure

Get a builder for handling the legacy endpoints.

https://api.mangadex.org/swagger.html#/Legacy

Get a builder for handling the manga endpoints.

https://api.mangadex.org/swagger.html#/Manga

Get a builder for handling the rating endpoints.

https://api.mangadex.org/swagger.html#/Rating

Get a builder for handling the report endpoints.

https://api.mangadex.org/swagger.html#/Report

Get a builder for handling the scanlation group endpoints.

https://api.mangadex.org/swagger.html#/ScanlationGroup

Get a builder for handling the search endpoints.

This is a convenience builder that aggregates search endpoints from various categories.

Get a builder for handling the settings endpoints.

https://api.mangadex.org/swagger.html#/Settings

Get a builder for handling the statistics endpoints.

https://api.mangadex.org/swagger.html#/Statistics

Get a builder for handling uploads.

https://api.mangadex.org/swagger.html#/Upload

Get a builder for handling the user endpoints.

https://api.mangadex.org/swagger.html#/User

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Create a new MangaDexClient with the default reqwest::Client settings.

Examples
use reqwest::Client;

use mangadex_api::v5::MangaDexClient;

let client = MangaDexClient::default();

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more