Skip to main content

flix_model/
id.rs

1//! This module contains types relating to flix media IDs.
2
3#![expect(clippy::module_name_repetitions, reason = "ID types end with Id")]
4
5use seamantic::model::id::Id;
6
7/// Type alias for the raw ID representation.
8pub use seamantic::model::id::SeaOrmRepr as RawId;
9
10#[doc(hidden)]
11#[non_exhaustive]
12#[derive(Debug, Clone, Copy)]
13pub enum Library {}
14/// Type alias for a library ID.
15pub type LibraryId = Id<Library>;
16
17#[doc(hidden)]
18#[non_exhaustive]
19#[derive(Debug, Clone, Copy)]
20pub enum Collection {}
21/// Type alias for a collection ID.
22pub type CollectionId = Id<Collection>;
23
24#[doc(hidden)]
25#[non_exhaustive]
26#[derive(Debug, Clone, Copy)]
27pub enum Movie {}
28/// Type alias for a movie ID.
29pub type MovieId = Id<Movie>;
30
31#[doc(hidden)]
32#[non_exhaustive]
33#[derive(Debug, Clone, Copy)]
34pub enum Show {}
35/// Type alias for a show ID.
36pub type ShowId = Id<Show>;
37
38#[cfg(test)]
39mod tests {
40	use super::{CollectionId, LibraryId, MovieId, ShowId};
41
42	#[test]
43	fn use_types() {
44		_ = CollectionId::from_raw(0);
45		_ = LibraryId::from_raw(0);
46		_ = MovieId::from_raw(0);
47		_ = ShowId::from_raw(0);
48	}
49}