mangadex_api/v5/
cover.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
34
35
36
37
38
39
40
41
42
//! Cover art endpoint handler.
//!
//! <https://api.mangadex.org/docs/swagger.html#/Cover>

pub mod cover_id;
pub mod get;
pub mod manga_id;

use uuid::Uuid;

use crate::v5::cover::get::ListCoverBuilder;
use crate::HttpClientRef;

use self::cover_id::CoverIdEndpoint;
use self::manga_id::MangaIdEndpoint;

/// Cover art endpoint handler builder.
#[derive(Debug)]
pub struct CoverBuilder {
    http_client: HttpClientRef,
}

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

    /// Search a list of cover art.
    ///
    /// <https://api.mangadex.org/swagger.html#/Cover/get-cover>
    pub fn get(&self) -> ListCoverBuilder {
        ListCoverBuilder::default().http_client(self.http_client.clone())
    }

    pub fn cover_id(&self, cover_id: Uuid) -> CoverIdEndpoint {
        CoverIdEndpoint::new(self.http_client.clone(), cover_id)
    }
    pub fn manga_id(&self, manga_id: Uuid) -> MangaIdEndpoint {
        MangaIdEndpoint::new(self.http_client.clone(), manga_id)
    }
}