pub enum Error {
Show 17 variants
PayloadNotBuilt,
HeaderNotBuilt,
OutOfBounds {
source: &'static str,
variable: &'static str,
},
SliceTooSmall,
InvalidProtocolVersion {
value: u8,
},
InvalidNackCode {
value: u8,
},
InvalidActionCode {
value: u8,
},
InvalidSyncStatus {
value: u8,
},
InvalidActivationCode {
value: u8,
},
InvalidActivationType {
value: u8,
},
InvalidNodeType {
value: u8,
},
InvalidPowerMode {
value: u8,
},
InvalidDiagnosticNackCode {
value: u8,
},
InvalidDiagnosticAckCode {
value: u8,
},
InvalidPayloadType {
value: [u8; 2],
},
BufferTooSmall {
size: usize,
},
SliceError(TryFromSliceError),
}Expand description
Custom Error enum for deriving error types across the application and API.
Expand to fit new dependencies using #[from] and implement custom error types
with context.
Variants§
PayloadNotBuilt
When utilising the builder pattern the payload is not present
HeaderNotBuilt
When utilising the builder pattern the header is not present
OutOfBounds
Errors when accessing a range out of the slices scope.
SliceTooSmall
When a slice is too small to be written to
InvalidProtocolVersion
Invalid ProtocolVersion
InvalidNackCode
Invalid NackCode
InvalidActionCode
Invalid ActionCode
InvalidSyncStatus
Invalid SyncStatus
InvalidActivationCode
Invalid ActivationCode
InvalidActivationType
Invalid ActivationType
InvalidNodeType
Invalid NodeType
InvalidPowerMode
Invalid PowerMode
InvalidDiagnosticNackCode
Invalid DiagnosticNackCode
InvalidDiagnosticAckCode
Invalid DiagnosticAckCode
InvalidPayloadType
Invalid PayloadType
BufferTooSmall
When the destination buffer is too small
SliceError(TryFromSliceError)
Derived implementation for standard library IO errors
Trait Implementations§
Source§impl From<TryFromSliceError> for Error
impl From<TryFromSliceError> for Error
Source§fn from(value: TryFromSliceError) -> Self
fn from(value: TryFromSliceError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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