pub struct Target {
pub hosts: Vec<Host>,
}Fields§
§hosts: Vec<Host>Implementations§
Source§impl Target
impl Target
Sourcepub fn new(hosts: Vec<Host>) -> Target
pub fn new(hosts: Vec<Host>) -> Target
Scan different ports for different targets, for example, we want to scan ports 22 and 23 of “192.168.1.1” and ports 80 and 81 of “192.168.1.2”, you can define the address and port range of each host yourself.
use pistol::Target;
use pistol::Host;
use std::net::Ipv4Addr;
use std::net::Ipv6Addr;
fn test() {
let host1 = Host::new(Ipv4Addr::new(192, 168, 72, 135).into(), Some(vec![22, 23]));
let host2 = Host::new(Ipv6Addr::new(0xfe80, 0x0000, 0x0000, 0x0000, 0x020c, 0x29ff, 0xfeb6, 0x8d99).into(), Some(vec![80, 81]));
let target = Target::new(vec![host1, host2]);
}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 Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin 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