use crate::keys::{error::KeyLabelError, validation::validate_static_key_label};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct KeyNamespace {
value: &'static str,
}
impl KeyNamespace {
pub fn from_static(value: &'static str) -> Result<Self, KeyLabelError> {
validate_static_key_label(value)?;
Ok(Self { value })
}
pub const fn as_str(self) -> &'static str {
self.value
}
}