pub struct ServicePort {
pub id: Option<i32>,
pub port: i32,
pub name: String,
}
Expand description
Represents an open service port on a discovered host.
This struct contains the port number, the name of the service running on that port, and an optional ID which can be used when storing in a database.
Fields§
§id: Option<i32>
§port: i32
§name: String
Implementations§
Source§impl ServicePort
impl ServicePort
Sourcepub fn new(port: i32, name: String) -> Self
pub fn new(port: i32, name: String) -> Self
Creates a new instance of ServicePort
without an ID.
This constructor is useful for newly discovered service ports that haven’t been persisted to a database yet.
§Arguments
port
- The port number of the service.name
- The name of the service running on the port.
§Returns
A new instance of ServicePort
with the specified port and service name.
Sourcepub fn new_with_id(id: i32, port: i32, name: String) -> Self
pub fn new_with_id(id: i32, port: i32, name: String) -> Self
Creates a new instance of ServicePort
with a specified ID.
This constructor is useful for service ports that have been persisted to a database and have a corresponding ID.
§Arguments
id
- The database ID of the service port.port
- The port number of the service.name
- The name of the service running on the port.
§Returns
A new instance of ServicePort
with the specified ID, port, and service name.
Trait Implementations§
Source§impl Clone for ServicePort
impl Clone for ServicePort
Source§fn clone(&self) -> ServicePort
fn clone(&self) -> ServicePort
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl CustomSerializer<ServicePort> for ServicePort
impl CustomSerializer<ServicePort> for ServicePort
Source§fn to_json_string(&self) -> String
fn to_json_string(&self) -> String
Serializes the implementor into a JSON string. Read more
Source§fn from_json_string(data_string: String) -> Twhere
T: for<'a> Deserialize<'a>,
fn from_json_string(data_string: String) -> Twhere
T: for<'a> Deserialize<'a>,
Deserializes an instance of the implementing type from a JSON string. Read more
Source§impl Debug for ServicePort
impl Debug for ServicePort
Source§impl<'de> Deserialize<'de> for ServicePort
impl<'de> Deserialize<'de> for ServicePort
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, R: Row> FromRow<'a, R> for ServicePort
impl<'a, R: Row> FromRow<'a, R> for ServicePort
Source§impl Ord for ServicePort
impl Ord for ServicePort
Source§fn cmp(&self, other: &ServicePort) -> Ordering
fn cmp(&self, other: &ServicePort) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ServicePort
impl PartialEq for ServicePort
Source§impl PartialOrd for ServicePort
impl PartialOrd for ServicePort
Source§impl Serialize for ServicePort
impl Serialize for ServicePort
impl Eq for ServicePort
impl StructuralPartialEq for ServicePort
Auto Trait Implementations§
impl Freeze for ServicePort
impl RefUnwindSafe for ServicePort
impl Send for ServicePort
impl Sync for ServicePort
impl Unpin for ServicePort
impl UnwindSafe for ServicePort
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> Comparable<K> for Q
impl<Q, K> Comparable<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