[][src]Struct nessus_xml_parser::NessusScan

pub struct NessusScan { /* fields omitted */ }

This struct holds the two sections of a Nessus XML file. Every XML file must have a single Policy section, and zero or one Report sections.

  • The Policy section contains information about the scan settings, plugins used, etc.

  • The Report section contains the results from having run a Nessus scan with the provided Policy

This crate provides iterators over the discovered hosts and ports.

Implementations

impl NessusScan[src]

pub fn policy(&self) -> &Policy[src]

Returns the Policy section from a report

pub fn report(&self) -> &Option<Report>[src]

Returns the Report section from a report

pub fn parse(nessus_xml_str: &str) -> Result<Self, Error>[src]

Attempt to parse an XML object as a Nessus report

let xml = r#"
<?xml version="1.0" ?>
<NessusClientData_v2>
...
</NessusClientData_v2>
"#;
let nessus = NessusScan::parse(&xml).unwrap();

pub fn hosts(&self) -> Iter<ReportHost>[src]

Returns an interator over the hosts in the scan

let xml = r#"
<?xml version="1.0" ?>
<NessusClientData_v2>
...
</NessusClientData_v2>
"#;
let nessus = NessusScan::parse(&xml).unwrap();
for host in nessus.hosts() {
    println!("Hostname: {}", host);    
}

pub fn ports(&self) -> IntoIter<(&ReportHost, Port)>[src]

Returns an interator over the ports in the scan.

let xml = r#"
<?xml version="1.0" ?>
<NessusClientData_v2>
...
</NessusClientData_v2>
"#;
let nessus = NessusScan::parse(&xml).unwrap();
for (host, port) in nessus.ports() {
    println!("Hostname: {}, port: {}", host, port.id);    
}

Trait Implementations

impl Debug for NessusScan[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.