mangadex_api/v5/
statistics.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
30
31
32
33
//! Statistics endpoint handler.
//!
//! <https://api.mangadex.org/swagger.html#/Statistics>

pub mod chapter;
pub mod group;
pub mod manga;

use crate::HttpClientRef;

use self::{chapter::ChapterEndpoint, group::GroupEndpoint, manga::MangaEndpoint};

/// Statistics endpoint handler builder.
#[derive(Clone, Debug)]
pub struct StatisticsBuilder {
    http_client: HttpClientRef,
}

impl StatisticsBuilder {
    #[doc(hidden)]
    pub(crate) fn new(http_client: HttpClientRef) -> Self {
        Self { http_client }
    }
    pub fn chapter(&self) -> ChapterEndpoint {
        ChapterEndpoint::new(self.http_client.clone())
    }
    pub fn group(&self) -> GroupEndpoint {
        GroupEndpoint::new(self.http_client.clone())
    }
    pub fn manga(&self) -> MangaEndpoint {
        MangaEndpoint::new(self.http_client.clone())
    }
}