mangadex_api/v5/
at_home.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//! MangaDex@Home endpoint handler.
//!
//! <https://api.mangadex.org/swagger.html#/AtHome>
pub mod server;

use crate::v5::at_home::server::ServerEndPoint;
use crate::HttpClientRef;

/// MangaDex@Home endpoint handler builder.
#[derive(Debug)]
pub struct AtHomeBuilder {
    http_client: HttpClientRef,
}

impl AtHomeBuilder {
    #[doc(hidden)]
    pub(crate) fn new(http_client: HttpClientRef) -> Self {
        Self { http_client }
    }

    /// Get a MangaDex@Home server URL.
    ///
    /// <https://api.mangadex.org/swagger.html#/AtHome/get-at-home-server-chapterId>
    ///
    /// This can be used to [fetch chapter pages](https://api.mangadex.org/swagger.html#/AtHome/Reading-a-chapter-using-the-API/Retrieving-pages-from-the-MangaDex@Home-network).
    pub fn server(&self) -> ServerEndPoint {
        ServerEndPoint::new(self.http_client.clone())
    }
}