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