pub struct BannerClassifier { /* private fields */ }Expand description
Top-level classifier — drop a banner in, get a ranked list of service matches out.
Implementations§
Source§impl BannerClassifier
impl BannerClassifier
Sourcepub fn new() -> Self
pub fn new() -> Self
Build a classifier seeded with builtin_rules.
Sourcepub fn with_rules(rules: Vec<ServiceRule>) -> Self
pub fn with_rules(rules: Vec<ServiceRule>) -> Self
Build a classifier from a custom rule set. Callers wiring in community-contributed TOML rule packs should use this.
Sourcepub fn classify(&self, banner: &str) -> Vec<ServiceMatch>
pub fn classify(&self, banner: &str) -> Vec<ServiceMatch>
Classify a single banner. Returns matches sorted by priority (highest first); empty vec when nothing fires.
Sourcepub fn classify_batch(&self, banners: &[&str]) -> Vec<Vec<ServiceMatch>>
pub fn classify_batch(&self, banners: &[&str]) -> Vec<Vec<ServiceMatch>>
Classify a batch of banners. Mirrors CpuMatcher::match_batch.
The returned outer vec has one entry per input banner; inner
vecs follow classify’s ordering.
Sourcepub fn classify_top(&self, banner: &str) -> Option<ServiceMatch>
pub fn classify_top(&self, banner: &str) -> Option<ServiceMatch>
First match for a banner, if any. Useful when callers only want the top service identification and don’t care about alternative rule hits.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BannerClassifier
impl RefUnwindSafe for BannerClassifier
impl Send for BannerClassifier
impl Sync for BannerClassifier
impl Unpin for BannerClassifier
impl UnsafeUnpin for BannerClassifier
impl UnwindSafe for BannerClassifier
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