pub struct Service { /* private fields */ }Expand description
Information about a detected service on a network port.
Implementations§
Source§impl Service
impl Service
Sourcepub fn new(name: impl Into<String>, confidence: u8) -> Self
pub fn new(name: impl Into<String>, confidence: u8) -> Self
Creates a new service record with a baseline confidence score.
Creates a new service identity.
The confidence value is clamped to a maximum of 100.
Sourcepub fn confidence(&self) -> u8
pub fn confidence(&self) -> u8
Returns the identification confidence score (0-100).
Sourcepub fn with_product(self, product: impl Into<String>) -> Self
pub fn with_product(self, product: impl Into<String>) -> Self
Builder method to assign a product string.
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Builder method to assign a version string.
Sourcepub fn add_cpe(self, cpe: impl Into<String>) -> Self
pub fn add_cpe(self, cpe: impl Into<String>) -> Self
Builder method to add a single CPE identifier.
Sourcepub fn merge(&mut self, other: Service)
pub fn merge(&mut self, other: Service)
Merges another service record into this one safely.
The merge strategy is confidence-driven. If the incoming other service
has a strictly higher confidence score, it will overwrite the primary
identity (name, product, version). Otherwise, it behaves additively,
filling in None fields and deduplicating CPEs.
Trait Implementations§
impl Eq for Service
impl StructuralPartialEq for Service
Auto Trait Implementations§
impl Freeze for Service
impl RefUnwindSafe for Service
impl Send for Service
impl Sync for Service
impl Unpin for Service
impl UnsafeUnpin for Service
impl UnwindSafe for Service
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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