pub struct TargetSet { /* private fields */ }Expand description
A set of addresses paired with the ports to try on each of them.
new merges the addresses and nothing mutates them afterwards, so a
TargetSet never holds overlapping ranges or miscounts them.
Implementations§
Source§impl TargetSet
impl TargetSet
Sourcepub fn new(ips: IpSet, ports: PortSet) -> Self
pub fn new(ips: IpSet, ports: PortSet) -> Self
Creates a scan blueprint over ips and ports.
Merges ips once, here, so every read takes &self.
Sourcepub fn into_ips(self) -> IpSet
pub fn into_ips(self) -> IpSet
Takes the IP set, discarding the ports.
For a phase with no use for ports, such as
discover, without cloning a set that may hold a
/8.
Sourcepub fn into_parts(self) -> (IpSet, PortSet)
pub fn into_parts(self) -> (IpSet, PortSet)
Takes the set apart into the two halves it was built from.
For rebuilding one, for example to withhold an excluded range, through
new. A &mut IpSet would let a caller leave the addresses
unmerged, which every count and membership test assumes they are not.
Sourcepub fn port_count(&self) -> usize
pub fn port_count(&self) -> usize
Returns the number of unique ports in this set.
Sourcepub fn total_targets(&self) -> Result<u128, TargetError>
pub fn total_targets(&self) -> Result<u128, TargetError>
Returns the total number of targets.
Returns a TargetError::CapacityOverflow if the calculation exceeds u128::MAX.
Trait Implementations§
impl Eq for TargetSet
impl StructuralPartialEq for TargetSet
Auto Trait Implementations§
impl Freeze for TargetSet
impl RefUnwindSafe for TargetSet
impl Send for TargetSet
impl Sync for TargetSet
impl Unpin for TargetSet
impl UnsafeUnpin for TargetSet
impl UnwindSafe for TargetSet
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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