#[non_exhaustive]pub enum Error {
Codex32(Error),
WrongHrp {
got: String,
},
ThresholdNotZero {
got: u8,
},
ShareIndexNotSecret {
got: char,
},
TagInvalidAlphabet {
got: [u8; 4],
},
UnknownTag {
got: [u8; 4],
},
ReservedTagNotEmittedInV01 {
got: [u8; 4],
},
ReservedPrefixViolation {
got: u8,
},
UnexpectedStringLength {
got: usize,
allowed: &'static [usize],
},
PayloadLengthMismatch {
tag: [u8; 4],
expected: &'static [usize],
got: usize,
},
}Expand description
ms-codec error type.
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.
Codex32(Error)
Upstream codex32 parse / checksum failure (delegated from rust-codex32).
WrongHrp
HRP was not “ms” (SPEC §4 rule 2).
ThresholdNotZero
Threshold was not 0 (SPEC §4 rule 3).
Share-index was not ‘s’ — BIP-93 requires ‘s’ for threshold=0 (SPEC §4 rule 4).
TagInvalidAlphabet
Tag bytes were not in the codex32 alphabet (SPEC §4 rule 5).
UnknownTag
Tag was structurally valid but not in RESERVED_TAG_TABLE (SPEC §4 rule 6).
ReservedTagNotEmittedInV01
Tag was in RESERVED_TAG_TABLE but reserved-not-emitted in v0.1 (SPEC §4 rule 7, SPEC §3.5.1 encoder symmetry).
ReservedPrefixViolation
Reserved-prefix byte was not 0x00 (SPEC §4 rule 8).
UnexpectedStringLength
Total string length was outside the v0.1 emittable set (SPEC §4 rule 9).
Fields
PayloadLengthMismatch
Payload byte length did not match the tag’s spec (SPEC §3.5, §4 rule 10).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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