operations capa

operations-net-scan

Thin bounded wrapper around nmap -oX -: cited Observations from a port/service scan, no verdicts

Thin bounded wrapper around nmap -oX -: cited Observations from a port/service scan, no verdicts

Tieroperations
Roleunclassified (baselined)
Pathcrates/operations/net-scan
Edition2021
Targetsoperations_net_scan
Public items8 across 0 modules
Tests4

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`

ItemWhat it is
pub enum NetScanErrorEvery 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 NmapPortOne <port> result under a <host>.
pub struct NmapHostOne <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)
Locationcrates/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.

CrateTierOptionalOnly on
`foundation-bounded-io`foundationnoalways
`infrastructure-host-forensics`infrastructurenoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
quick-xml^0.41noalways
thiserror^2noalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1fullnoalways

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

KindNameSource
liboperations_net_scan`src/lib.rs`

Error model

Error typeNamed by
NetScanErrorparse_nmap_xml, scan

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
CARGO_MANIFEST_DIRsrc/lib.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests4
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root600

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc68
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 6
    "No rustdoc detected" : 2

Metrics

MetricValue
Rust source files1
Source lines286
Code lines227
Public API items8
Public modules0
Tests4
Examples0
Cargo features0
Direct runtime dependencies4
Workspace reverse dependencies0
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.

Todas las operations · Manual