#[non_exhaustive]pub enum CidV1Error {
#[non_exhaustive] UnsupportedMultibase,
#[non_exhaustive] InvalidBase32 {
at: u32,
byte: u8,
},
#[non_exhaustive] NonCanonicalBase32,
#[non_exhaustive] WrongLength {
got: u32,
},
#[non_exhaustive] UnsupportedPrefix {
got: [u8; 4],
},
}Expand description
Error from Sha256::from_cidv1 and Sha256::from_cidv1_bytes.
#[non_exhaustive] at the type level and per variant, so new
variants and new fields stay semver-additive.
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.
#[non_exhaustive]UnsupportedMultibase
The string does not start with the multibase prefix b
(lowercase base32, no padding). Other multibase encodings,
including B (uppercase base32), are not accepted.
#[non_exhaustive]InvalidBase32
A byte after the multibase prefix is outside the lowercase
base32 alphabet a-z 2-7.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]NonCanonicalBase32
The base32 text has a length no byte string encodes to, or its unused trailing bits are not zero, so it is not the canonical encoding of any binary CID.
#[non_exhaustive]WrongLength
The binary CID is not 36 bytes long.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]UnsupportedPrefix
The first four bytes are not 0x01 0x55 0x12 0x20, so the CID
is not a version 1, raw, sha2-256 CID.
Trait Implementations§
Source§impl Clone for CidV1Error
impl Clone for CidV1Error
Source§impl Debug for CidV1Error
impl Debug for CidV1Error
Source§impl Display for CidV1Error
impl Display for CidV1Error
impl Eq for CidV1Error
Source§impl Error for CidV1Error
impl Error for CidV1Error
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()
Source§impl PartialEq for CidV1Error
impl PartialEq for CidV1Error
impl StructuralPartialEq for CidV1Error
Auto Trait Implementations§
impl Freeze for CidV1Error
impl RefUnwindSafe for CidV1Error
impl Send for CidV1Error
impl Sync for CidV1Error
impl Unpin for CidV1Error
impl UnsafeUnpin for CidV1Error
impl UnwindSafe for CidV1Error
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