pub struct NessusClientDataV2<'input> {
pub policy: Policy<'input>,
pub report: Option<Report<'input>>,
}
Expand description
Represents the root of a Nessus v2 XML report, corresponding to the
<NessusClientData_v2>
element.
This is the main entry point for a parsed .nessus
file. It contains the
scan policy that was used and the report itself, which holds the results
of the scan.
Fields§
§policy: Policy<'input>
The policy configuration used for the Nessus scan.
report: Option<Report<'input>>
The results of the scan, containing all discovered hosts and their vulnerabilities.
Implementations§
Source§impl<'input> NessusClientDataV2<'input>
impl<'input> NessusClientDataV2<'input>
Sourcepub fn parse(xml: &'input str) -> Result<Self, FormatError>
pub fn parse(xml: &'input str) -> Result<Self, FormatError>
Parses a string containing a .nessus
(v2) XML report.
This function is the main entry point for the parser. It takes the entire
XML content of a .nessus
file as a string slice and attempts to parse
it into a structured NessusClientDataV2
object.
§Errors
Returns a FormatError
if the input string is not a valid Nessus v2
report. This can happen for several reasons, including:
- The XML is malformed.
- The root element is not
<NessusClientData_v2>
. - Required elements or attributes (e.g.,
<Policy>
) are missing. - Elements that should be unique appear multiple times.
- Data cannot be converted to the expected type (e.g., a non-integer value for a port number).