rust_anilist/models/
mod.rs

1// SPDX-License-Identifier: MIT↴
2// Copyright (c) 2022-2025 Andriel Ferreira <https://github.com/AndrielFR>↴
3
4//! This module contains various models and structures used in the library.
5
6mod anime;
7mod character;
8mod color;
9mod cover;
10mod date;
11mod format;
12mod gender;
13mod image;
14mod language;
15mod link;
16mod manga;
17mod media;
18mod name;
19mod notification;
20mod person;
21mod relation;
22mod season;
23mod source;
24mod status;
25mod studio;
26mod tag;
27mod title;
28mod user;
29
30pub use anime::Anime;
31pub use character::{Character, CharacterRole};
32pub use color::Color;
33pub use cover::Cover;
34pub use date::Date;
35pub use format::Format;
36pub use gender::Gender;
37pub use image::Image;
38pub use language::Language;
39pub use link::{Link, LinkType};
40pub use manga::Manga;
41pub use media::Media;
42pub use name::Name;
43pub use notification::{Notification, NotificationOption, NotificationType};
44pub use person::Person;
45pub use relation::{Relation, RelationType};
46pub use season::Season;
47pub use source::Source;
48pub use status::Status;
49pub use studio::Studio;
50pub use tag::Tag;
51pub use title::Title;
52pub use user::User;
53
54use serde::{Deserialize, Serialize};
55
56/// Represents different types of media.
57///
58/// The `MediaType` enum defines various types of media, such as anime,
59/// manga, character, user, person, studio, and an unknown type.
60///
61/// # Variants
62///
63/// * `Anime` - Represents an anime.
64/// * `Manga` - Represents a manga.
65/// * `Character` - Represents a character.
66/// * `User` - Represents a user.
67/// * `Person` - Represents a person.
68/// * `Studio` - Represents a studio.
69/// * `Unknown` - Represents an unknown type of media.
70#[derive(Debug, Default, Clone, Eq, Hash, PartialEq, Deserialize, Serialize)]
71pub enum MediaType {
72    /// An anime.
73    Anime,
74    /// A manga.
75    Manga,
76    /// A character.
77    Character,
78    /// An user.
79    User,
80    /// A person.
81    Person,
82    /// A studio.
83    Studio,
84    /// Unknown type.
85    #[default]
86    Unknown,
87}