pub enum Error {
Show 20 variants
DeviceNotFound {
device_id: String,
},
DeviceAlreadyExists {
device_id: String,
},
DataPointNotFound {
device_id: String,
point_id: String,
},
InvalidAddress {
address: u32,
min: u32,
max: u32,
},
InvalidValue {
point_id: String,
reason: String,
},
TypeMismatch {
expected: String,
actual: String,
},
Protocol(String),
Config(String),
Validation {
message: String,
errors: ValidationErrors,
},
Io(Error),
Engine(String),
Lifecycle {
from: DeviceState,
to: DeviceState,
},
CapacityExceeded {
current: usize,
max: usize,
resource: String,
},
Timeout {
duration_ms: u64,
},
NotSupported(String),
Internal(String),
Serialization(String),
Channel(String),
AccessDenied {
point_id: String,
operation: String,
mode: String,
},
OutOfRange {
point_id: String,
value: f64,
min: f64,
max: f64,
},
}Expand description
Simulator error types.
Variants§
DeviceNotFound
Device not found.
DeviceAlreadyExists
Device already exists.
DataPointNotFound
Data point not found.
InvalidAddress
Invalid address.
InvalidValue
Invalid value.
TypeMismatch
Type mismatch.
Protocol(String)
Protocol error.
Config(String)
Configuration error.
Validation
Validation errors (multiple field errors).
Io(Error)
I/O error.
Engine(String)
Engine error.
Lifecycle
Lifecycle error.
CapacityExceeded
Capacity exceeded.
Timeout
Timeout.
NotSupported(String)
Not supported.
Internal(String)
Internal error.
Serialization(String)
Serialization error.
Channel(String)
Channel error.
AccessDenied
Access denied (for access mode violations).
OutOfRange
Range error (for out-of-range values).
Implementations§
Source§impl Error
impl Error
Sourcepub fn device_not_found(device_id: impl Into<String>) -> Self
pub fn device_not_found(device_id: impl Into<String>) -> Self
Create a device not found error.
Sourcepub fn point_not_found(
device_id: impl Into<String>,
point_id: impl Into<String>,
) -> Self
pub fn point_not_found( device_id: impl Into<String>, point_id: impl Into<String>, ) -> Self
Create a data point not found error.
Sourcepub fn capacity_exceeded(
current: usize,
max: usize,
resource: impl Into<String>,
) -> Self
pub fn capacity_exceeded( current: usize, max: usize, resource: impl Into<String>, ) -> Self
Create a capacity exceeded error.
Sourcepub fn access_denied(
point_id: impl Into<String>,
operation: impl Into<String>,
mode: impl Into<String>,
) -> Self
pub fn access_denied( point_id: impl Into<String>, operation: impl Into<String>, mode: impl Into<String>, ) -> Self
Create an access denied error.
Sourcepub fn out_of_range(
point_id: impl Into<String>,
value: f64,
min: f64,
max: f64,
) -> Self
pub fn out_of_range( point_id: impl Into<String>, value: f64, min: f64, max: f64, ) -> Self
Create an out of range error.
Sourcepub fn validation(errors: ValidationErrors) -> Self
pub fn validation(errors: ValidationErrors) -> Self
Create a validation error from a ValidationErrors instance.
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable.
Sourcepub fn is_validation(&self) -> bool
pub fn is_validation(&self) -> bool
Check if this is a validation error.
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this is a not found error.
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get error severity.