#[non_exhaustive]pub enum SparkplugError {
Show 15 variants
InvalidTopic(String),
InvalidId(String),
Truncated,
VarintOverflow,
InvalidWireType(u8),
InvalidUtf8,
UnknownDataType(u32),
MissingDataType(String),
ArrayLength {
len: usize,
width: usize,
},
DataSetShape(String),
ValueTypeMismatch(String),
RecursionLimit,
InvalidState(String),
Io(Error),
Transport(String),
}Expand description
Errors produced while building, encoding, decoding, or parsing Sparkplug B data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidTopic(String)
A topic string was not a valid Sparkplug B topic.
InvalidId(String)
A Group/Edge-Node/Device identifier was empty or contained a reserved
character (+, /, #).
Truncated
The protobuf byte stream ended unexpectedly.
VarintOverflow
A protobuf varint exceeded 64 bits.
InvalidWireType(u8)
A protobuf field used a wire type the schema does not allow.
InvalidUtf8
A string field was not valid UTF-8.
UnknownDataType(u32)
A datatype code on the wire was not one of the enumerated Sparkplug data types.
MissingDataType(String)
A DATA/CMD metric omitted its datatype and it could not be recovered from a prior birth (by name or alias).
ArrayLength
A packed numeric array had a length that is not a multiple of the element width.
Fields
DataSetShape(String)
A DataSet’s columns/types/rows shapes were inconsistent.
ValueTypeMismatch(String)
A metric’s value did not match the field set expected for its datatype.
RecursionLimit
Decoding hit the maximum nesting depth (defends against hostile inputs).
InvalidState(String)
A STATE JSON payload was malformed.
Io(Error)
An I/O error from bdSeq persistence.
Transport(String)
An MQTT transport error (connect/subscribe/publish/receive).
Trait Implementations§
Source§impl Debug for SparkplugError
impl Debug for SparkplugError
Source§impl Display for SparkplugError
impl Display for SparkplugError
Source§impl Error for SparkplugError
impl Error for SparkplugError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()