#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum JsonValueKind {
Null,
Boolean,
Integer,
Float,
String,
Array,
Object,
}
impl JsonValueKind {
pub const fn is_null(self) -> bool {
matches!(self, Self::Null)
}
pub const fn is_bool(self) -> bool {
matches!(self, Self::Boolean)
}
pub const fn is_integer(self) -> bool {
matches!(self, Self::Integer)
}
pub const fn is_float(self) -> bool {
matches!(self, Self::Float)
}
pub const fn is_number(self) -> bool {
matches!(self, Self::Integer | Self::Float)
}
pub const fn is_string(self) -> bool {
matches!(self, Self::String)
}
pub const fn is_array(self) -> bool {
matches!(self, Self::Array)
}
pub const fn is_object(self) -> bool {
matches!(self, Self::Object)
}
}