pub struct ConfigCategorizer { /* private fields */ }Expand description
A FileCategorizer built from a slice of CategorizerConfig
entries (the user-facing TOML surface). Each entry is matched
by extension (lowercased file suffix) or by the leading
magic_bytes; the first match wins. Used alongside the static
built-in registry so users can route .bin / .dat /
extensionless executables without recompiling. Fixes
limnifs#196.
Implementations§
Source§impl ConfigCategorizer
impl ConfigCategorizer
pub fn new(entries: Vec<CategorizerConfig>) -> Self
Trait Implementations§
Source§impl Debug for ConfigCategorizer
impl Debug for ConfigCategorizer
Source§impl FileCategorizer for ConfigCategorizer
impl FileCategorizer for ConfigCategorizer
Source§fn categories(&self) -> &'static [&'static str]
fn categories(&self) -> &'static [&'static str]
Categories this categorizer can emit. Used for diagnostic
dumps; does not affect dispatch.
Source§fn categorize(&self, path: &Path, data: &[u8]) -> Option<Categorization>
fn categorize(&self, path: &Path, data: &[u8]) -> Option<Categorization>
Categorize a file by its path and full contents. Read more
Auto Trait Implementations§
impl Freeze for ConfigCategorizer
impl RefUnwindSafe for ConfigCategorizer
impl Send for ConfigCategorizer
impl Sync for ConfigCategorizer
impl Unpin for ConfigCategorizer
impl UnsafeUnpin for ConfigCategorizer
impl UnwindSafe for ConfigCategorizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more