Expand description
State machine module.
Non-blocking state machines for all network operations.
Each state machine has a step() method that returns immediately.
§Design Principles
- No blocking:
step()returns immediately, never waits - Timeout as observation: Check elapsed time, don’t spin
- State transitions: Move to next state when condition met
- Composable: State machines can contain other state machines
§Usage Pattern
ⓘ
loop {
// Poll network stack (exactly once per iteration)
iface.poll(now, device, sockets);
// Step state machine (returns immediately)
match state_machine.step(now_tsc, &timeouts) {
StepResult::Pending => continue,
StepResult::Done => break,
StepResult::Timeout => handle_timeout(),
StepResult::Failed => handle_error(),
}
}§Reference
NETWORK_IMPL_GUIDE.md §5
Re-exports§
pub use dhcp::DhcpState;pub use dns::DnsResolveState;pub use download::IsoDownloadState;pub use http::HttpDownloadState;pub use tcp::TcpConnState;
Modules§
- DHCP client state machine.
- ISO Streaming Disk Writer State Machine.
- DNS resolution state machine.
- ISO download orchestration state machine.
- HTTP download state machine.
- TCP connection state machine.
Structs§
- Progress information for long-running operations.
- Context passed to state machine step functions.
- TSC timestamp wrapper for timeout calculations.
Enums§
- Common error type for state machines.
- Result of a state machine step.