#[non_exhaustive]pub enum TargetParseError {
Empty,
Blank(usize, &'static str),
UnbalancedBracket(String),
TrailingText(String),
EmptyPorts(String),
Address {
expression: String,
source: IpParseError,
},
Ports {
expression: String,
source: PortSetParseError,
},
NoHostLookup(String),
MistypedAddress(String),
UnbracketedAddress(String),
UnknownHost(String),
ResolvedToNothing(String),
}Expand description
Why a target expression could not be turned into targets.
Every variant carries the expression it is about; an importer adds the line.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
The token was empty.
Blank(usize, &'static str)
The token held nothing but whitespace.
Its own variant because a token of spaces looks like the gap between two
arguments, usually from a stray \ in the shell.
UnbalancedBracket(String)
A bracketed address was never closed.
TrailingText(String)
Something followed the closing bracket other than a port specification.
EmptyPorts(String)
The separator was there and the port specification was not.
Address
The address half named nothing scannable.
Fields
source: IpParseErrorWhat the address grammar made of it.
Ports
The port half was not a port specification.
Fields
source: PortSetParseErrorWhat the port grammar made of it.
NoHostLookup(String)
The address half is a hostname and the caller supplied no lookup.
MistypedAddress(String)
Not an address or a range, and shaped like no host name either.
A typo: 192.0.2.300, 10.10.10.* and 10.10.10.0/ are addresses or ranges
written wrong. Never sent to a lookup, which would leak the range to a resolver.
UnbracketedAddress(String)
Something with colons in it that is neither an address nor bracketed.
A hostname cannot contain a colon. Almost always an IPv6 target that needs brackets to carry its ports.
UnknownHost(String)
The lookup returned nothing for the name.
ResolvedToNothing(String)
The expression parsed and named nothing to scan.
Reached through a keyword: a ResolverFn that returns without inserting an
address, as for lan on a host with no LAN. Distinct from
Empty (a token with no expression) and
UnknownHost (a name nothing answered to). The engine’s
own resolver always inserts on success, so only a caller-supplied resolver
reaches this.
Trait Implementations§
Source§impl Clone for TargetParseError
impl Clone for TargetParseError
Source§impl Coded for TargetParseError
impl Coded for TargetParseError
Source§impl Debug for TargetParseError
impl Debug for TargetParseError
Source§impl Display for TargetParseError
impl Display for TargetParseError
impl Eq for TargetParseError
Source§impl Error for TargetParseError
impl Error for TargetParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<TargetParseError> for RequestError
Available on crate feature import-request only.
impl From<TargetParseError> for RequestError
import-request only.Source§fn from(source: TargetParseError) -> Self
fn from(source: TargetParseError) -> Self
Source§impl PartialEq for TargetParseError
impl PartialEq for TargetParseError
impl StructuralPartialEq for TargetParseError
Auto Trait Implementations§
impl Freeze for TargetParseError
impl RefUnwindSafe for TargetParseError
impl Send for TargetParseError
impl Sync for TargetParseError
impl Unpin for TargetParseError
impl UnsafeUnpin for TargetParseError
impl UnwindSafe for TargetParseError
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