3 /// The error that can occur when creating a [`Uuid`].
5 /// [`Uuid`]: struct.Uuid.html
6 #[derive(Clone, Debug, Eq, Hash, PartialEq)]
7 pub(crate) struct Error
{
13 /// The expected number of bytes.
15 const fn expected(&self) -> usize {
19 /// The number of bytes found.
21 const fn found(&self) -> usize {
25 /// Create a new [`UuidError`].
27 /// [`UuidError`]: struct.UuidError.html
29 pub(crate) const fn new(expected
: usize, found
: usize) -> Self {
30 Error { expected, found }
34 impl fmt
::Display
for Error
{
35 fn fmt(&self, f
: &mut fmt
::Formatter
<'_
>) -> fmt
::Result
{
38 "invalid bytes length: expected {}, found {}",
45 #[cfg(feature = "std")]
49 use crate::std
::error
;
51 impl error
::Error
for Error {}