Expand description
Cross-platform inspection, mutation, and monitoring of operating-system networking through a strongly typed Rust API.
Start with Lattice::connect to inspect interfaces, addresses, routes,
DNS configuration, and neighbor tables; perform supported mutations; or
subscribe to network change events.
§Example
use net_lattice::{Lattice, Result};
fn main() -> Result<()> {
let lattice = Lattice::connect()?;
for interface in lattice.interfaces()? {
println!("{interface:?}");
}
Ok(())
}§Facade design
Re-exports the types consumers need from net-lattice-model and
net-lattice-ip, selects a default backend based on cfg(target_os = "..."), and enforces model convergence: net-lattice-platform’s generic
provider traits are constrained here to Net Lattice’s own model types,
without net-lattice-platform ever depending on net-lattice-model. See
ARCHITECTURE.md for the full rationale.
Structs§
- Capability
- Runtime-dependent operating system features that cannot be expressed through Rust trait implementation alone.
- DnsConfig
- The resolver configuration observed through the active platform backend.
- Event
Filter - A composable filter for event domains and individual network objects.
- Event
Receiver - Event
Stream - Async event adapters, enabled by the
asyncfeature. A runtime-agnostic asynchronous stream of network change events. - Id
- A phantom-typed identifier, generic over the domain object it names.
- Interface
- A network interface.
- Interface
Address - An IP address assigned to a network interface, plus the prefix length it
was assigned with (e.g.
192.168.1.10/24). - Ipv4
Address - A typed IPv4 address.
- Ipv4
Network - An IPv4 network: an address paired with a prefix length.
- Ipv4
Prefix Length - A validated IPv4 prefix length (0..=32).
- Ipv6
Address - A typed IPv6 address.
- Ipv6
Network - An IPv6 network: an address paired with a prefix length.
- Ipv6
Prefix Length - A validated IPv6 prefix length (0..=128).
- Lattice
- The top-level entry point: a connected backend for the current system.
- MacAddress
- A MAC (Ethernet hardware) address.
- Neighbor
Entry - A single entry in the system’s neighbor table (ARP for IPv4, NDP for IPv6): the mapping from an on-link IP address to a link-layer (MAC) address, as observed or configured on a given interface.
- NewInterface
Address - Intent to assign an IP address to an interface.
- Route
- A single routing table entry.
Enums§
- Admin
State - The administrative state of an interface, as configured by the operator.
- Change
Kind - What kind of change an
Eventreports. - Error
- The single error type surfaced across the Net Lattice workspace.
- Event
- A signal that something changed in the system’s networking state —
carrying an ID and a
ChangeKind, not a clone of the full domain object. - Event
Domain - A domain whose state must be re-read after an overflow notification.
- Interface
Kind - The kind of a network interface.
- IpAddress
- An IP address of either family.
- Neighbor
State - The reachability state of a neighbor entry, per the Neighbor Unreachability
Detection state machine shared (with minor naming differences) by Linux’s
NUD_*states, BSD/macOS’s route-socketRTF_*flags on an ARP/NDP entry, and Windows’sNL_NEIGHBOR_STATE. - Network
- An IP network of either family.
- Operational
State - The operational state of an interface, as observed from the link layer.
- Platform
Error Code - A platform-tagged raw error code.
Traits§
- Address
Mutator - Assigns and removes IP addresses on network interfaces.
- Address
Provider - Lists IP addresses assigned to network interfaces.
- Capability
Provider - Reports which runtime-dependent
Capabilityflags the connected backend currently has available. - DnsProvider
- Reads the system’s current DNS resolver configuration.
- Event
Provider - Subscribes to filtered change notifications for the domains and objects a backend supports.
- Interface
Provider - Lists network interfaces.
- Lattice
Backend - Bound satisfied by any backend usable with
Lattice. - Neighbor
Provider - Lists neighbor table entries (ARP for IPv4, NDP for IPv6).
- Route
Provider - Lists, adds, and removes routes.
- Tokio
Event Provider - Backend contract for native Tokio-based event delivery.
Type Aliases§
- Interface
Address Id - Identifies an
InterfaceAddress. - Interface
Id - Identifies an
Interface. - Neighbor
Id - Identifies a
NeighborEntry. - Result
- A result returned by Net Lattice operations.
- RouteId
- Identifies a
Route.