icydb_core/value/
family.rs1#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14pub enum ValueFamily {
15 Numeric, Textual, Identifier, Enum, Collection, Blob, Bool,
22 Null, Unit, Unsupported,
25}
26
27impl ValueFamily {
28 #[must_use]
29 pub const fn is_numeric(self) -> bool {
30 matches!(self, Self::Numeric)
31 }
32
33 #[must_use]
34 pub const fn is_textual(self) -> bool {
35 matches!(self, Self::Textual)
36 }
37
38 #[must_use]
39 pub const fn is_identifier(self) -> bool {
40 matches!(self, Self::Identifier)
41 }
42
43 #[must_use]
44 pub const fn is_collection(self) -> bool {
45 matches!(self, Self::Collection)
46 }
47
48 #[must_use]
49 pub const fn is_enum(self) -> bool {
50 matches!(self, Self::Enum)
51 }
52
53 #[must_use]
54 pub const fn is_null(self) -> bool {
55 matches!(self, Self::Null)
56 }
57
58 #[must_use]
59 pub const fn is_scalar(self) -> bool {
60 !self.is_collection() && !matches!(self, Self::Unit)
62 }
63}
64
65pub trait ValueFamilyExt {
70 fn family(&self) -> ValueFamily;
71}