pub(crate) use std::hash::Hash;
pub(crate) use std::hash::Hasher;
pub(crate) use std::fmt::Debug;
pub(crate) use std::ops::Index;
pub(crate) use std::ops::IndexMut;
pub(crate) use std::fmt::Formatter;
pub(crate) use std::iter::Peekable;
pub(crate) use std::str::Utf8Error;
pub(crate) use std::collections::VecDeque;
pub(crate) use bytes::Bytes;
pub(crate) use regex::Regex;
pub(crate) use vec_map::VecMap;
pub(crate) use thiserror::Error;
pub(crate) use indexmap::IndexMap;
#[allow(missing_docs)]
#[derive(Debug, Error)]
pub enum RadixError {
#[error("path is empty")]
PathEmpty,
#[error("path not found")]
PathNotFound,
#[error("{0}")]
PathInvalid(#[from] Utf8Error),
#[error("{0}")]
PathMalformed(&'static str),
#[error("rule can't be split")]
RuleIndivisible,
#[error("{0}")]
GlobInvalid(#[from] glob::PatternError),
#[error("{0}")]
RegexInvalid(#[from] regex::Error),
}
pub type RadixResult<T> = Result<T, RadixError>;
#[macro_export]
macro_rules! radix {
($($path:expr => $data:expr),+ $(,)?) => {{
let mut map = $crate::RadixMap::default();
$(map.insert($path, $data);)+
map
}};
($($path:expr),+ $(,)?) => {{
let mut set = $crate::RadixSet::default();
$(set.insert($path);)+
set
}};
}