pub enum ProtocolError {
Sentence(SentenceError),
Incomplete(MissingWord),
WordSequence {
word: WordType,
expected: Vec<WordType>,
},
TrapCategory(TrapCategoryError),
}Expand description
Possible errors while parsing a [CommandResponse] from a [Sentence].
This enum provides more detailed information about issues that can arise while parsing command responses, such as missing tags, missing attributes, or unexpected attributes.
Variants§
Sentence(SentenceError)
Error related to the [Sentence].
This variant encapsulates errors that occur due to issues in parsing a
[Sentence] from bytes.
Incomplete(MissingWord)
Error related to the length of a response.
Indicates that the response is missing some words to be a valid response.
WordSequence
The received sequence of words is not a valid response.
Fields
TrapCategory(TrapCategoryError)
Error related to identifying or parsing a [Trap] response category.
Indicates that an invalid category was encountered during parsing, which likely points to either a malformed response.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl From<MissingWord> for ProtocolError
impl From<MissingWord> for ProtocolError
Source§fn from(e: MissingWord) -> Self
fn from(e: MissingWord) -> Self
Converts to this type from the input type.
Source§impl From<SentenceError> for ProtocolError
impl From<SentenceError> for ProtocolError
Source§fn from(e: SentenceError) -> Self
fn from(e: SentenceError) -> Self
Converts to this type from the input type.
Source§impl From<TrapCategoryError> for ProtocolError
impl From<TrapCategoryError> for ProtocolError
Source§fn from(e: TrapCategoryError) -> Self
fn from(e: TrapCategoryError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnwindSafe for ProtocolError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more