#[non_exhaustive]pub enum FromSliceError {
#[non_exhaustive] InvalidLength {
expected: usize,
got: usize,
},
}Expand description
Error returned when a byte slice cannot be converted to Fixed<[u8; N]> due to
length mismatch. Produced by Fixed::try_from(&[u8]).
Error returned when a byte slice cannot be converted to a fixed-size array.
Carries the expected and actual lengths in all build profiles. Lengths are public protocol parameters, not secret material.
The std::error::Error impl requires the std feature. Without it the
type still exists and still implements Display, but
it is not an Error, so ? into Box<dyn Error> and std::io::Error::other
will not compile. This is an MSRV consequence, not a policy: core::error::Error
needs Rust 1.81 and this line targets 1.70. On 0.9.x the impl is
unconditional and available in no_std.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]InvalidLength
The slice length does not match the target array length.
Fields
This variant is marked as non-exhaustive
Trait Implementations§
Source§impl Clone for FromSliceError
impl Clone for FromSliceError
Source§fn clone(&self) -> FromSliceError
fn clone(&self) -> FromSliceError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FromSliceError
Source§impl Debug for FromSliceError
impl Debug for FromSliceError
Source§impl Display for FromSliceError
impl Display for FromSliceError
impl Eq for FromSliceError
Source§impl Error for FromSliceError
Available on crate feature std only.
impl Error for FromSliceError
std only.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()