Enum Error

Source
pub enum Error {
Show 16 variants Field(Error), IdNotLength4(usize), IncompleteGroup(usize), InvalidLength(usize), InvalidChar(char), InvalidCase(Case, char), InvalidChecksum { checksum: &'static str, string: String, }, InvalidThreshold(char), InvalidThresholdN(usize), InvalidShareIndex(Fe), MismatchedLength(usize, usize), MismatchedHrp(String, String), MismatchedThreshold(usize, usize), MismatchedId(String, String), RepeatedIndex(Fe), ThresholdNotPassed { threshold: usize, n_shares: usize, },
}

Variants§

§

Field(Error)

Error related to a single bech32 character

§

IdNotLength4(usize)

Identifier had wrong length when creating a share

§

IncompleteGroup(usize)

When translating from u5 to u8, there was an incomplete group of size greater than 4 bits, meaning an entirely extraneous character.

§

InvalidLength(usize)

Tried a codex32 string of an illegal length

§

InvalidChar(char)

Tried to decode a character which was not part of the bech32 alphabet, or, if in the HRP, was not ASCII.

§

InvalidCase(Case, char)

Tried to decode a character but its case did not match the expected case

§

InvalidChecksum

String had an invalid checksum

Fields

§checksum: &'static str

Checksum we used, “long” or “short”

§string: String

The string with the bad checksum

§

InvalidThreshold(char)

Threshold was not an allowed value (2 through 9, or 0)

§

InvalidThresholdN(usize)

Threshold was not an allowed value (2 through 9, or 0)

§

InvalidShareIndex(Fe)

Share index was not an allowed value (only S if the threshold is 0, otherwise anything goes)

§

MismatchedLength(usize, usize)

A set of shares to be interpolated did not all have the same length

§

MismatchedHrp(String, String)

A set of shares to be interpolated did not all have the same HRP

§

MismatchedThreshold(usize, usize)

A set of shares to be interpolated did not all have the same threshold

§

MismatchedId(String, String)

A set of shares to be interpolated did not all have the same ID

§

RepeatedIndex(Fe)

A share index was repeated in the set of shares to interpolate.

§

ThresholdNotPassed

A set of shares to be interpolated did not have enough shares

Fields

§threshold: usize
§n_shares: usize

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.