pub struct PortQuery { /* private fields */ }
Expand description
Find the ports used by a process
Implementations§
Source§impl PortQuery
impl PortQuery
Sourcepub fn ip_v4_only(self) -> Self
pub fn ip_v4_only(self) -> Self
Only consider IPv4 addresses
Sourcepub fn ip_v6_only(self) -> Self
pub fn ip_v6_only(self) -> Self
Only consider IPv6 addresses
Sourcepub fn expect_min_num_ports(self, num_ports: usize) -> Self
pub fn expect_min_num_ports(self, num_ports: usize) -> Self
Require at least num_ports
ports to be bound by the matched process for the query to succeed.
Sourcepub fn process_id(self, pid: Pid) -> Self
pub fn process_id(self, pid: Pid) -> Self
Set the process ID to match
Either this function or process_id_from_child
are required to be called before the query is usable.
Sourcepub fn process_id_from_child(self, child: &Child) -> Self
pub fn process_id_from_child(self, child: &Child) -> Self
Get the process ID of a child process
Either this function or process_id
are required to be called before the query is usable.
Sourcepub fn execute(&self) -> ProcCtlResult<Vec<ProtocolPort>>
pub fn execute(&self) -> ProcCtlResult<Vec<ProtocolPort>>
Execute the query
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PortQuery
impl RefUnwindSafe for PortQuery
impl Send for PortQuery
impl Sync for PortQuery
impl Unpin for PortQuery
impl UnwindSafe for PortQuery
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> 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