pub enum BlockError<B> {
BlockSizeMismatch {
expected: usize,
actual: usize,
block: B,
},
}Expand description
Error returned by block state transitions.
Every variant carries the originating block back to the caller so that the block is never silently leaked on failure. The caller can inspect the error, recover the block from the variant, and retry or drop it as needed.
Variants§
BlockSizeMismatch
The number of tokens in the provided data did not match the block’s
fixed size. The block is returned in the block field.
Trait Implementations§
Source§impl<B: Debug> Debug for BlockError<B>
impl<B: Debug> Debug for BlockError<B>
Source§impl<B> Display for BlockError<B>
impl<B> Display for BlockError<B>
Source§impl<B> Error for BlockError<B>
impl<B> Error for BlockError<B>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl<B> Freeze for BlockError<B>where
B: Freeze,
impl<B> RefUnwindSafe for BlockError<B>where
B: RefUnwindSafe,
impl<B> Send for BlockError<B>where
B: Send,
impl<B> Sync for BlockError<B>where
B: Sync,
impl<B> Unpin for BlockError<B>where
B: Unpin,
impl<B> UnsafeUnpin for BlockError<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for BlockError<B>where
B: UnwindSafe,
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