#[non_exhaustive]pub enum CidError {
MissingScheme,
Malformed,
UnknownAlgorithm(String),
InvalidDigest(&'static str),
WrongDigestLength {
alg: &'static str,
expected: usize,
got: usize,
},
}Expand description
Reasons a string is not a well-formed CID.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MissingScheme
The pub: scheme prefix was absent.
Malformed
The three-part structure was not present.
UnknownAlgorithm(String)
The algorithm identifier is not implemented.
InvalidDigest(&'static str)
The digest was not lower-case unpadded base32.
WrongDigestLength
The digest length did not match the algorithm.
Trait Implementations§
impl Eq for CidError
Source§impl Error for CidError
impl Error for CidError
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()
impl StructuralPartialEq for CidError
Auto Trait Implementations§
impl Freeze for CidError
impl RefUnwindSafe for CidError
impl Send for CidError
impl Sync for CidError
impl Unpin for CidError
impl UnsafeUnpin for CidError
impl UnwindSafe for CidError
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