#[non_exhaustive]pub struct TargetMap {
pub units: Vec<TargetSet>,
}Expand description
A collection of multiple TargetSet units.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.units: Vec<TargetSet>The units, in the order they were added.
Public because there is no invariant to protect: each TargetSet is
canonical and immutable, and this type caches nothing derived from them.
Implementations§
Source§impl TargetMap
impl TargetMap
Sourcepub fn names(&self, protocol: Protocol) -> bool
pub fn names(&self, protocol: Protocol) -> bool
Whether any unit names a port on protocol.
Read when a scan is assembled, to decide whether a transport not probed by default needs a socket.
Sourcepub fn gross_targets(&self) -> Result<u128, TargetError>
pub fn gross_targets(&self) -> Result<u128, TargetError>
Returns the gross total of target connections across all units.
Gross: two units naming the same address each count it, since they ask different questions about it.
Sourcepub fn gross_ips(&self) -> Result<u128, TargetError>
pub fn gross_ips(&self) -> Result<u128, TargetError>
Returns the gross number of IP addresses across all units.
Sourcepub fn iter(&self) -> impl Iterator<Item = Target> + Send + '_
pub fn iter(&self) -> impl Iterator<Item = Target> + Send + '_
Creates a flattened iterator over every target in every unit.
Sourcepub fn withhold_ports(&mut self, excluded: &PortSet)
pub fn withhold_ports(&mut self, excluded: &PortSet)
Takes excluded out of every unit’s ports, and drops a unit left with
none.
A unit with every port excluded has nothing to ask, so a liveness pass spends no
probes on its addresses. A scan does this itself with
ZondConfig::excluded_ports; a
caller estimating a scan’s cost beforehand does it to a copy.
Trait Implementations§
impl Eq for TargetMap
Source§impl From<&PlanRecord> for TargetMap
impl From<&PlanRecord> for TargetMap
Source§fn from(record: &PlanRecord) -> Self
fn from(record: &PlanRecord) -> Self
Source§impl From<&TargetMap> for PlanRecord
impl From<&TargetMap> for PlanRecord
impl StructuralPartialEq for TargetMap
Auto Trait Implementations§
impl Freeze for TargetMap
impl RefUnwindSafe for TargetMap
impl Send for TargetMap
impl Sync for TargetMap
impl Unpin for TargetMap
impl UnsafeUnpin for TargetMap
impl UnwindSafe for TargetMap
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