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