Expand description
Prelude module for convenient imports.
This module re-exports commonly used types for CLI development.
Re-exports§
pub use crate::commands::BacnetCommand;pub use crate::commands::KnxCommand;pub use crate::commands::ListCommand;pub use crate::commands::ModbusCommand;pub use crate::commands::OpcuaCommand;pub use crate::commands::ProtocolCommand;pub use crate::commands::RunCommand;pub use crate::commands::ValidateCommand;pub use crate::context::CliContext;pub use crate::context::CliContextBuilder;pub use crate::error::CliError;pub use crate::error::CliResult;pub use crate::error::CliResultExt;pub use crate::output::OutputFormat;pub use crate::output::OutputWriter;pub use crate::output::StatusType;pub use crate::output::TableBuilder;pub use crate::runner::Command;pub use crate::runner::CommandHook;pub use crate::runner::CommandOutput;pub use crate::runner::CommandRunner;pub use crate::runner::LoggingHook;pub use crate::runner::MetricsHook;
Modules§
- instrument
- Attach a span to a
std::future::Future.
Macros§
- builder_
setter - Implement a builder pattern setter method.
- builder_
setter_ into - Implement a builder pattern setter method that takes impl Into
. - builder_
setter_ option - Implement a builder pattern setter method for Option
. - debug
- Constructs an event at the debug level.
- error
- Constructs an event at the error level.
- info
- Constructs an event at the info level.
- trace
- Constructs an event at the trace level.
- trace_
device - Create a span for tracing device operations.
- trace_
error - Log a failed operation with error details.
- trace_
request - Create a span for tracing protocol requests.
- trace_
success - Log a successful operation with timing.
- warn
- Constructs an event at the warn level.
Structs§
- BacNet
Address - BACnet address.
- Bacnet
IpConfig - BACnet/IP configuration.
- Capability
Set - A set of capabilities supported by a device or protocol.
- Capability
SetBuilder - Builder for creating custom capability sets.
- Config
Watcher - Configuration watcher for hot reload support.
- Data
Point - A data point with value, quality, and timestamp.
- Data
Point Builder - Builder for data point definitions with chainable API.
- Data
Point Config - Data point configuration.
- Data
Point Def - Data point definition (metadata).
- Data
Point Id - Unique identifier for a data point.
- Device
Config - Device configuration.
- Device
Config Builder - Builder for creating device configurations.
- Device
Context - Device context for device-specific operations.
- Device
Info - Device information.
- Device
Statistics - Device statistics.
- Engine
Config - Main engine configuration.
- Factory
Metadata - Metadata about a device factory.
- Factory
Registry - Registry for device factories.
- KnxIp
Config - KNXnet/IP configuration.
- Latency
Stats - Latency statistics with percentile calculations.
- Lifecycle
State Machine - Lifecycle state machine that manages state transitions.
- LogConfig
- Logging configuration.
- LogConfig
Builder - Builder for LogConfig.
- LogFile
Stats - Statistics about log files for a given directory.
- LogLevel
Controller - Controller for dynamic log level management.
- Metrics
Collector - Metrics collector for the simulator.
- Metrics
Snapshot - Snapshot of current metrics.
- Modbus
Address - Modbus address.
- Modbus
RtuConfig - Modbus RTU configuration.
- Modbus
TcpConfig - Modbus TCP configuration.
- NoOp
Lifecycle Hook - A no-op lifecycle hook for use as a default.
- OpcUa
Config - OPC UA configuration.
- Plugin
Info - Information about a loaded plugin.
- Plugin
Manager - Plugin manager for loading and managing plugins.
- Quality
- Data quality flags.
- Rate
Limiter - Simple rate limiter using token bucket algorithm.
- Request
Context - Request context for protocol operations.
- Retention
Policy - Represents the retention policy for log files.
- Retry
Config - Retry configuration.
- Rotation
Config - Log rotation configuration.
- Simulator
Engine - Simulator engine that manages all virtual devices.
- Simulator
Engine Builder - Builder for creating SimulatorEngine with fluent API.
- Stopwatch
- Simple stopwatch for measuring elapsed time.
- Timer
- Simple timer for measuring operation duration.
- Trace
Context - Trace context for distributed tracing.
- Typed
Data Point - A type-safe data point reference.
- Typed
Point Value - A typed data point value with quality and timestamp.
- Validation
Errors - Collection of validation errors with field-level details.
- Validation
Errors Builder - Builder for ValidationErrors.
Enums§
- Access
Mode - Access mode.
- Address
- Protocol-specific address.
- Capability
- Standard capabilities that protocols may support.
- Config
Event - Configuration change event.
- Config
Source - Configuration source identifier.
- Data
Type - Data types.
- Device
State - Device state.
- Engine
Event - Engine events.
- Engine
Preset - Engine configuration presets.
- Engine
State - Engine state.
- Error
- Simulator error types.
- Error
Severity - Error severity levels.
- Lifecycle
Event - Lifecycle event types.
- LogFormat
- Log output format.
- LogLevel
- Log level configuration.
- LogTarget
- Log output target.
- Modbus
Register Type - Modbus register types.
- Protocol
- Supported protocols.
- Protocol
Config - Protocol-specific configuration.
- Rotation
Strategy - Rotation strategy for log files.
- Stop
Reason - Reason for device stop.
- Value
- Dynamic value type for data points.
- Value
Type - Value types for conversion.
- Watcher
State - Configuration watcher state.
Traits§
- Config
Event Handler - Trait for handling configuration events.
- Data
Point Type - A trait for types that can be stored in data points.
- Device
- Core device trait that all protocol devices must implement.
- Device
Factory - A factory trait for creating devices.
- Device
Lifecycle - Lifecycle management trait for devices.
- From
Definition - Helper trait for creating typed points from definitions.
- Lifecycle
Hook - Lifecycle hook trait for extending lifecycle behavior.
- Numeric
Point - Common numeric point operations.
- Plugin
- Plugin trait for extending the simulator.
- Protocol
Capabilities - Trait for types that have protocol capabilities.
- Result
Ext - Extension trait for Result to add context.
Functions§
- create_
config_ watcher - Create a shared config watcher.
- current_
timestamp_ ms - Get current timestamp in milliseconds since UNIX epoch.
- current_
timestamp_ ns - Get current timestamp in nanoseconds since UNIX epoch.
- current_
timestamp_ us - Get current timestamp in microseconds since UNIX epoch.
- default_
capabilities - Get the default capabilities for a protocol.
- device
- Shorthand function to create a new device config builder.
- engine
- Shorthand function for creating an engine builder.
- format_
bytes - Convert bytes to human-readable format.
- format_
duration - Format duration as human-readable string.
- generate_
sequential_ id - Generate a sequential ID with prefix.
- generate_
short_ uuid - Generate a short UUID (first 8 characters).
- generate_
timestamp_ id - Generate a timestamp-based ID.
- generate_
uuid - Generate a new UUID v4.
- init_
logging - Initialize logging with the given configuration.
- init_
test_ logging - Initialize logging for tests.
- is_
logging_ initialized - Check if logging has been initialized.
- point
- Shorthand function to create a new data point builder.
- retry_
async - Retry an async operation with exponential backoff.
- sanitize_
identifier - Sanitize a string for use as an identifier.
- shared_
context - Create a shared trace context.
- truncate_
string - Truncate a string to a maximum length.
Type Aliases§
- Bool
Point - Boolean data point.
- Boxed
Device - Type alias for a boxed device.
- Boxed
Factory - A type-erased device factory.
- Boxed
Plugin - A boxed plugin.
- Float32
Point - 32-bit floating point data point.
- Float64
Point - 64-bit floating point data point.
- Int32
Point - 32-bit signed integer data point.
- Int64
Point - 64-bit signed integer data point.
- Result
- Result type alias using [
Error]. - Shared
Config Watcher - Arc-wrapped ConfigWatcher for shared access.
- String
Point - String data point.
- UInt32
Point - 32-bit unsigned integer data point.
- UInt64
Point - 64-bit unsigned integer data point.
Attribute Macros§
- async_
trait - instrument
- Instruments a function to create and enter a
tracingspan every time the function is called.