pub enum Error {
InvalidData,
BadLength {
found: usize,
expected: usize,
},
InvalidChar {
ch: char,
index: usize,
},
}Expand description
Dusk Bytes operation error variants
Variants§
InvalidData
Generic error that can be returned in a
Serializable::from_bytes
implementation.
BadLength
Automatically returned from the default implementation of
DeserializableSlice::from_slice
if the slice given is smaller than the mandatory size for the struct.
InvalidChar
Automatically returned from the default implementation of
ParseHexStr::from_hex_str if an
invalid character is found in the string slice.
Trait Implementations§
Source§impl BadLength for Error
impl BadLength for Error
Source§fn bad_length(found: usize, expected: usize) -> Self
fn bad_length(found: usize, expected: usize) -> Self
Invoked when a buffer of bad length is given to
DeserializableSlice::from_slice.impl Copy for Error
impl Eq for Error
Source§impl InvalidChar for Error
impl InvalidChar for Error
Source§fn invalid_char(ch: char, index: usize) -> Self
fn invalid_char(ch: char, index: usize) -> Self
Invoked when a string slice with a non-hex character is given to
ParseHexStr::from_hex_str.Source§impl Ord for Error
impl Ord for Error
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Error
impl PartialOrd for Error
impl StructuralPartialEq for Error
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