#[non_exhaustive]pub struct Connection {
pub destination_ip: String,
pub destination_port: i32,
pub source_ip: String,
pub source_port: i32,
pub protocol: Protocol,
/* private fields */
}Expand description
Contains information about the IP connection associated with the finding.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.destination_ip: StringDestination IP address. Not present for sockets that are listening and not connected.
destination_port: i32Destination port. Not present for sockets that are listening and not connected.
source_ip: StringSource IP address.
source_port: i32Source port.
protocol: ProtocolIANA Internet Protocol Number such as TCP(6) and UDP(17).
Implementations§
Source§impl Connection
impl Connection
pub fn new() -> Self
Sourcepub fn set_destination_ip<T: Into<String>>(self, v: T) -> Self
pub fn set_destination_ip<T: Into<String>>(self, v: T) -> Self
Sets the value of destination_ip.
§Example
ⓘ
let x = Connection::new().set_destination_ip("example");Sourcepub fn set_destination_port<T: Into<i32>>(self, v: T) -> Self
pub fn set_destination_port<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_source_ip<T: Into<String>>(self, v: T) -> Self
pub fn set_source_ip<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_source_port<T: Into<i32>>(self, v: T) -> Self
pub fn set_source_port<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_protocol<T: Into<Protocol>>(self, v: T) -> Self
pub fn set_protocol<T: Into<Protocol>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
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 Debug for Connection
impl Debug for Connection
Source§impl Default for Connection
impl Default for Connection
Source§fn default() -> Connection
fn default() -> Connection
Returns the “default value” for a type. Read more
Source§impl PartialEq for Connection
impl PartialEq for Connection
impl StructuralPartialEq for Connection
Auto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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