BoxliteError
Central error enum for all BoxLite operations.BoxliteResult
Result type alias for BoxLite operations.Error Handling Example
RuntimeMetrics
Runtime-wide metrics (aggregate across all boxes).Methods
| Method | Return | Description |
|---|---|---|
boxes_created_total() | u64 | Total boxes created |
boxes_failed_total() | u64 | Total boxes that failed to start |
num_running_boxes() | u64 | Currently running boxes |
total_commands_run() | u64 | Total run() calls |
total_run_errors() | u64 | Total run errors |
BoxMetrics
Per-box metrics (individual LiteBox statistics).Fields
| Field | Type | Description |
|---|---|---|
commands_run_total | u64 | Commands on this box |
run_errors_total | u64 | Run errors on this box |
bytes_sent_total | u64 | Bytes sent (stdin) |
bytes_received_total | u64 | Bytes received (stdout/stderr) |
total_create_duration_ms | Option<u128> | Total init time |
guest_boot_duration_ms | Option<u128> | Guest boot time |
cpu_percent | Option<f32> | CPU usage (0-100) |
memory_bytes | Option<u64> | Memory usage |
network_bytes_sent | Option<u64> | Network TX |
network_bytes_received | Option<u64> | Network RX |
network_tcp_connections | Option<u64> | Active TCP connections |
network_tcp_errors | Option<u64> | TCP connection errors |
Stage Timing
| Field | Description |
|---|---|
stage_filesystem_setup_ms | Stage 1: Directory setup |
stage_image_prepare_ms | Stage 2: Image pull/extract |
stage_guest_rootfs_ms | Stage 3: Guest rootfs bootstrap |
stage_box_config_ms | Stage 4: Box config build |
stage_box_spawn_ms | Stage 5: Subprocess spawn |
stage_container_init_ms | Stage 6: Container init |
Type Utilities
Bytes
Semantic newtype for byte sizes.Seconds
Semantic newtype for durations.BoxID
Box identifier in ULID format (26 characters, sortable).ContainerID
Container identifier (64-char lowercase hex, OCI format).Thread Safety
All public types areSend + Sync:
BoxliteRuntime- safely shareable across threadsLiteBox- safely shareable across threadsExecution- Clone + shareable