pub enum Error {
InvalidTypeString {
signature: String,
offset: usize,
reason: &'static str,
},
TypeMismatch {
expected: String,
found: &'static str,
},
InvalidValue(&'static str),
NotNormal(&'static str),
DepthExceeded,
}Expand description
An error of the GVariant codec.
The functions that encode and decode GVariant bytes return it.
Type::parse, to_text, and to_text_unannotated also return it.
from_text returns a TextError.
Variants§
InvalidTypeString
A type signature string that Type::parse refuses.
Fields
reason: &'static strThe reason for the failure.
Type::parse lists each reason.
TypeMismatch
The value does not match its type.
to_bytes, to_text, and to_text_unannotated return it.
Fields
InvalidValue(&'static str)
GVariant cannot represent the value.
This crate returns it for a string that holds an interior NUL byte. The field holds the reason.
NotNormal(&'static str)
The serialized bytes are not normal-form GVariant of the expected type.
The field names the deviation.
DepthExceeded
The container nesting exceeds the depth limit of 128 levels.
Each variant, array, maybe, tuple, and dict entry adds one level.
from_bytes, validate, tuple_field_from_bytes, and
to_bytes return it. The decode of a Variant returns it through
from_bytes. Type::parse applies the same limit to a signature
and returns Error::InvalidTypeString.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()