Skip to main content

Module prelude

Module prelude 

Source
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§

BacNetAddress
BACnet address.
BacnetIpConfig
BACnet/IP configuration.
CapabilitySet
A set of capabilities supported by a device or protocol.
CapabilitySetBuilder
Builder for creating custom capability sets.
ConfigWatcher
Configuration watcher for hot reload support.
DataPoint
A data point with value, quality, and timestamp.
DataPointBuilder
Builder for data point definitions with chainable API.
DataPointConfig
Data point configuration.
DataPointDef
Data point definition (metadata).
DataPointId
Unique identifier for a data point.
DeviceConfig
Device configuration.
DeviceConfigBuilder
Builder for creating device configurations.
DeviceContext
Device context for device-specific operations.
DeviceInfo
Device information.
DeviceStatistics
Device statistics.
EngineConfig
Main engine configuration.
FactoryMetadata
Metadata about a device factory.
FactoryRegistry
Registry for device factories.
KnxIpConfig
KNXnet/IP configuration.
LatencyStats
Latency statistics with percentile calculations.
LifecycleStateMachine
Lifecycle state machine that manages state transitions.
LogConfig
Logging configuration.
LogConfigBuilder
Builder for LogConfig.
LogFileStats
Statistics about log files for a given directory.
LogLevelController
Controller for dynamic log level management.
MetricsCollector
Metrics collector for the simulator.
MetricsSnapshot
Snapshot of current metrics.
ModbusAddress
Modbus address.
ModbusRtuConfig
Modbus RTU configuration.
ModbusTcpConfig
Modbus TCP configuration.
NoOpLifecycleHook
A no-op lifecycle hook for use as a default.
OpcUaConfig
OPC UA configuration.
PluginInfo
Information about a loaded plugin.
PluginManager
Plugin manager for loading and managing plugins.
Quality
Data quality flags.
RateLimiter
Simple rate limiter using token bucket algorithm.
RequestContext
Request context for protocol operations.
RetentionPolicy
Represents the retention policy for log files.
RetryConfig
Retry configuration.
RotationConfig
Log rotation configuration.
SimulatorEngine
Simulator engine that manages all virtual devices.
SimulatorEngineBuilder
Builder for creating SimulatorEngine with fluent API.
Stopwatch
Simple stopwatch for measuring elapsed time.
Timer
Simple timer for measuring operation duration.
TraceContext
Trace context for distributed tracing.
TypedDataPoint
A type-safe data point reference.
TypedPointValue
A typed data point value with quality and timestamp.
ValidationErrors
Collection of validation errors with field-level details.
ValidationErrorsBuilder
Builder for ValidationErrors.

Enums§

AccessMode
Access mode.
Address
Protocol-specific address.
Capability
Standard capabilities that protocols may support.
ConfigEvent
Configuration change event.
ConfigSource
Configuration source identifier.
DataType
Data types.
DeviceState
Device state.
EngineEvent
Engine events.
EnginePreset
Engine configuration presets.
EngineState
Engine state.
Error
Simulator error types.
ErrorSeverity
Error severity levels.
LifecycleEvent
Lifecycle event types.
LogFormat
Log output format.
LogLevel
Log level configuration.
LogTarget
Log output target.
ModbusRegisterType
Modbus register types.
Protocol
Supported protocols.
ProtocolConfig
Protocol-specific configuration.
RotationStrategy
Rotation strategy for log files.
StopReason
Reason for device stop.
Value
Dynamic value type for data points.
ValueType
Value types for conversion.
WatcherState
Configuration watcher state.

Traits§

ConfigEventHandler
Trait for handling configuration events.
DataPointType
A trait for types that can be stored in data points.
Device
Core device trait that all protocol devices must implement.
DeviceFactory
A factory trait for creating devices.
DeviceLifecycle
Lifecycle management trait for devices.
FromDefinition
Helper trait for creating typed points from definitions.
LifecycleHook
Lifecycle hook trait for extending lifecycle behavior.
NumericPoint
Common numeric point operations.
Plugin
Plugin trait for extending the simulator.
ProtocolCapabilities
Trait for types that have protocol capabilities.
ResultExt
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§

BoolPoint
Boolean data point.
BoxedDevice
Type alias for a boxed device.
BoxedFactory
A type-erased device factory.
BoxedPlugin
A boxed plugin.
Float32Point
32-bit floating point data point.
Float64Point
64-bit floating point data point.
Int32Point
32-bit signed integer data point.
Int64Point
64-bit signed integer data point.
Result
Result type alias using [Error].
SharedConfigWatcher
Arc-wrapped ConfigWatcher for shared access.
StringPoint
String data point.
UInt32Point
32-bit unsigned integer data point.
UInt64Point
64-bit unsigned integer data point.

Attribute Macros§

async_trait
instrument
Instruments a function to create and enter a tracing span every time the function is called.