Skip to main content

BannerClassifier

Struct BannerClassifier 

Source
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

Source

pub fn new() -> Self

Build a classifier seeded with builtin_rules.

Source

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.

Source

pub fn classify(&self, banner: &str) -> Vec<ServiceMatch>

Classify a single banner. Returns matches sorted by priority (highest first); empty vec when nothing fires.

Source

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.

Source

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§

Source§

impl Default for BannerClassifier

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.