pub struct TargetParser {
allow_hostnames: bool,
allow_files: bool,
}Expand description
Parser for various target formats
Fields§
§allow_hostnames: boolWhether to allow hostname resolution
allow_files: boolWhether to allow file paths
Implementations§
Source§impl TargetParser
impl TargetParser
Sourcepub fn with_settings(allow_hostnames: bool, allow_files: bool) -> Self
pub fn with_settings(allow_hostnames: bool, allow_files: bool) -> Self
Create a new target parser with custom settings
Sourcepub fn parse(&self, input: &str) -> Result<Target, TargetParseError>
pub fn parse(&self, input: &str) -> Result<Target, TargetParseError>
Parse a target string into a Target enum
Sourcepub fn parse_multiple(
&self,
input: &str,
) -> Result<Vec<Target>, TargetParseError>
pub fn parse_multiple( &self, input: &str, ) -> Result<Vec<Target>, TargetParseError>
Parse multiple targets from a string (comma or space separated)
Sourcepub async fn parse_file(
&self,
path: &PathBuf,
) -> Result<Vec<Target>, TargetParseError>
pub async fn parse_file( &self, path: &PathBuf, ) -> Result<Vec<Target>, TargetParseError>
Parse targets from a file
Sourcepub fn extract_ips(&self, target: &Target) -> Vec<IpAddr>
pub fn extract_ips(&self, target: &Target) -> Vec<IpAddr>
Extract all IP addresses from a target
Sourcepub async fn get_targets_from_file(
&self,
target: &Target,
) -> Result<Vec<Target>, TargetParseError>
pub async fn get_targets_from_file( &self, target: &Target, ) -> Result<Vec<Target>, TargetParseError>
Get all targets from a file
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TargetParser
impl RefUnwindSafe for TargetParser
impl Send for TargetParser
impl Sync for TargetParser
impl Unpin for TargetParser
impl UnwindSafe for TargetParser
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request