pub struct Target {
pub id: Uuid,
pub address: String,
pub port: Option<u16>,
pub protocol: Protocol,
pub metadata: HashMap<String, String>,
}Expand description
Scan target specification
Fields§
§id: UuidUnique target ID
address: StringTarget address (IP or hostname)
port: Option<u16>Target port (optional)
protocol: ProtocolProtocol to use
metadata: HashMap<String, String>Additional metadata
Implementations§
Source§impl Target
impl Target
Sourcepub fn with_port<S: Into<String>>(
address: S,
port: u16,
protocol: Protocol,
) -> Self
pub fn with_port<S: Into<String>>( address: S, port: u16, protocol: Protocol, ) -> Self
Create target with port
Sourcepub fn socket_addr(&self) -> Option<SocketAddr>
pub fn socket_addr(&self) -> Option<SocketAddr>
Get socket address if possible
Sourcepub fn with_both_schemes(&self) -> Vec<Target>
pub fn with_both_schemes(&self) -> Vec<Target>
Create variants with both HTTP and HTTPS for flexible testing This allows a single HTTP template to test both protocols
Sourcepub fn infer_scheme(&self) -> Protocol
pub fn infer_scheme(&self) -> Protocol
Smart scheme selection based on port
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Target
impl<'de> Deserialize<'de> for Target
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for Target
impl Freeze for Target
impl Move for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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