Thin bounded wrapper around nmap -oX -: cited Observations from a port/service scan, no verdicts
| Tier | operations |
| Role | unclassified (baselined) |
| Path | crates/operations/net-scan |
| Edition | 2021 |
| Targets | operations_net_scan |
| Public items | 8 across 0 modules |
| Tests | 4 |
What it is for
Thin bounded wrapper around nmap -oX -: cited Observations from a port/service scan, no verdicts.
XML shape verified live against a real nmap -oX - -p 22,80,443 127.0.0.1 run on this machine (not assumed). Notably: nmap emits a preliminary <hosthint> element (same child shape as <host>, no port results) during a scan before the final <host> — this parser only builds records from real <host> elements, <hosthint> is explicitly skipped, not merely ignored-by-omission.
quick-xml's Reader/event-loop idiom here matches the existing consumer in this workspace (crates/operations/test-results-ingest/src/junit.rs) rather than introducing a different XML-parsing style.
Capabilities
crate root
Thin bounded wrapper around nmap -oX -: cited Observations from a port/service
| Item |
|---|
fn parse_nmap_xml(xml : & str) -> Result <Vec <NmapHost>, NetScanError> |
NetScanError
Thin bounded wrapper around nmap -oX -: cited Observations from a port/service
| Item |
|---|
pub enum NetScanError |
NetScanError :: fn from(e : quick_xml::Error) -> Self |
NetScanError :: fn from(e : quick_xml::events::attributes::AttrError) -> Self |
async fn scan(nmap_bin : impl Into <PathBuf>, args : & & str, limits : ExecLimits,) -> Result <Vec <Observation>, NetScanError> |
NmapHost
Thin bounded wrapper around nmap -oX -: cited Observations from a port/service
| Item |
|---|
pub struct NmapHost |
fn to_observations(hosts : & NmapHost) -> Vec <Observation> |
NmapPort
Thin bounded wrapper around nmap -oX -: cited Observations from a port/service
| Item |
|---|
pub struct NmapPort |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub enum NetScanError | Every way a scan can fail. |
NetScanError :: fn from(e : quick_xml::Error) -> Self | — |
NetScanError :: fn from(e : quick_xml::events::attributes::AttrError) -> Self | — |
pub struct NmapPort | One <port> result under a <host>. |
pub struct NmapHost | One <host> result — never built from <hosthint>. |
fn parse_nmap_xml(xml : & str) -> Result <Vec <NmapHost>, NetScanError> | Parse nmap -oX - XML into one NmapHost per real <host> (never <hosthint>) |
fn to_observations(hosts : & NmapHost) -> Vec <Observation> | Lift parsed hosts into cited Observations, one per port (or one per host if it has no ports — e.g |
async fn scan(nmap_bin : impl Into <PathBuf>, args : & & str, limits : ExecLimits,) -> Result <Vec <Observation>, NetScanError> | Run nmap -oX - <args> and cite each discovered host/port |
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into foundation, infrastructure.
Shares tier operations with 40 other crates: operations-approval-workflow, operations-assessments, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-liveview, operations-camera-registry, … (40 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | operations |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/operations/net-scan |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_operations["operations"] --> n_foundation["foundation"] n_operations["operations"] --> n_infrastructure["infrastructure"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-bounded-io` | foundation | no | always |
| `infrastructure-host-forensics` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
quick-xml | ^0.41 | — | no | always |
thiserror | ^2 | — | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full | no | always |
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["operations-net-scan"] SELF -->|runtime| n_foundation_bounded_io["foundation-bounded-io"] SELF -->|runtime| n_infrastructure_host_forensics["infrastructure-host-forensics"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | operations_net_scan | `src/lib.rs` |
Error model
| Error type | Named by |
|---|---|
NetScanError | parse_nmap_xml, scan |
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | yes |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
| Variable | Read in |
|---|---|
CARGO_MANIFEST_DIR | src/lib.rs |
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 4 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 6 | 0 | 0 |
What the tests establish, by name:
parse_nmap_xml_reads_port_protocol_state_and_service—src/lib.rsparse_nmap_xml_skips_hosthint_and_reads_the_real_host—src/lib.rsscan_wires_stdout_through_the_parser—src/lib.rsto_observations_cites_one_observation_per_port—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 6 | 8 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 6
"No rustdoc detected" : 2
Metrics
| Metric | Value |
|---|---|
| Rust source files | 1 |
| Source lines | 286 |
| Code lines | 227 |
| Public API items | 8 |
| Public modules | 0 |
| Tests | 4 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 4 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"enum" : 1
"function" : 3
"method" : 2
"struct" : 2
pie showData
title Rust source composition
"Code" : 227
"Blank or comment" : 59
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.