icydb_core/db/index/key/
id.rs1use crate::db::identity::{EntityNameError, IndexName, IndexNameError};
2use derive_more::Display;
3use thiserror::Error as ThisError;
4
5#[derive(Clone, Copy, Debug, Display, Eq, Hash, Ord, PartialEq, PartialOrd)]
14pub struct IndexId(pub IndexName);
15
16impl IndexId {
17 #[must_use]
20 pub const fn max_storable() -> Self {
21 Self(IndexName::max_storable())
22 }
23}
24
25#[derive(Debug, ThisError)]
32pub enum IndexIdError {
33 #[error("entity name invalid: {0}")]
34 EntityName(#[from] EntityNameError),
35
36 #[error("index name invalid: {0}")]
37 IndexName(#[from] IndexNameError),
38}