Struct bech32::Fe32

source ·
pub struct Fe32(/* private fields */);
Expand description

An element in GF(32), the finite field containing elements [0,31] inclusive.

Implementations§

source§

impl Fe32

source

pub const Q: Fe32 = _

Numeric value maps to bech32 character: 0 == “q”.

source

pub const P: Fe32 = _

Numeric value maps to bech32 character: 1 == “p”.

source

pub const Z: Fe32 = _

Numeric value maps to bech32 character: 2 == “z”.

source

pub const R: Fe32 = _

Numeric value maps to bech32 character: 3 == “r”.

source

pub const Y: Fe32 = _

Numeric value maps to bech32 character: 4 == “y”.

source

pub const _9: Fe32 = _

Numeric value maps to bech32 character: 5 == “9”.

source

pub const X: Fe32 = _

Numeric value maps to bech32 character: 6 == “x”.

source

pub const _8: Fe32 = _

Numeric value maps to bech32 character: 7 == “8”.

source

pub const G: Fe32 = _

Numeric value maps to bech32 character: 8 == “g”.

source

pub const F: Fe32 = _

Numeric value maps to bech32 character: 9 == “f”.

source

pub const _2: Fe32 = _

Numeric value maps to bech32 character: 10 == “2”.

source

pub const T: Fe32 = _

Numeric value maps to bech32 character: 11 == “t”.

source

pub const V: Fe32 = _

Numeric value maps to bech32 character: 12 == “v”.

source

pub const D: Fe32 = _

Numeric value maps to bech32 character: 13 == “d”.

source

pub const W: Fe32 = _

Numeric value maps to bech32 character: 14 == “w”.

source

pub const _0: Fe32 = _

Numeric value maps to bech32 character: 15 == “0”.

source

pub const S: Fe32 = _

Numeric value maps to bech32 character: 16 == “s”.

source

pub const _3: Fe32 = _

Numeric value maps to bech32 character: 17 == “3”.

source

pub const J: Fe32 = _

Numeric value maps to bech32 character: 18 == “j”.

source

pub const N: Fe32 = _

Numeric value maps to bech32 character: 19 == “n”.

source

pub const _5: Fe32 = _

Numeric value maps to bech32 character: 20 == “5”.

source

pub const _4: Fe32 = _

Numeric value maps to bech32 character: 21 == “4”.

source

pub const K: Fe32 = _

Numeric value maps to bech32 character: 22 == “k”.

source

pub const H: Fe32 = _

Numeric value maps to bech32 character: 23 == “h”.

source

pub const C: Fe32 = _

Numeric value maps to bech32 character: 24 == “c”.

source

pub const E: Fe32 = _

Numeric value maps to bech32 character: 25 == “e”.

source

pub const _6: Fe32 = _

Numeric value maps to bech32 character: 26 == “6”.

source

pub const M: Fe32 = _

Numeric value maps to bech32 character: 27 == “m”.

source

pub const U: Fe32 = _

Numeric value maps to bech32 character: 28 == “u”.

source

pub const A: Fe32 = _

Numeric value maps to bech32 character: 29 == “a”.

source

pub const _7: Fe32 = _

Numeric value maps to bech32 character: 30 == “7”.

source

pub const L: Fe32 = _

Numeric value maps to bech32 character: 31 == “l”.

source

pub fn iter_alpha() -> impl Iterator<Item = Fe32>

Iterator over all field elements, in alphabetical order.

source

pub fn from_char(c: char) -> Result<Fe32, FromCharError>

Creates a field element from a single bech32 character.

§Errors

If the input char is not part of the bech32 alphabet.

source

pub fn from_char_unchecked(c: u8) -> Fe32

Creates a field element from a single bech32 character.

§Panics

If the input character is not part of the bech32 alphabet.

source

pub fn to_char(self) -> char

Converts the field element to a lowercase bech32 character.

source

pub fn to_u8(self) -> u8

Converts the field element to a 5-bit u8, with bits representing the coefficients of the polynomial representation.

Trait Implementations§

source§

impl Add<&Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the + operator.
source§

fn add(self, other: &Fe32) -> Fe32

Performs the + operation. Read more
source§

impl Add<&Fe32> for Fe32

§

type Output = Fe32

The resulting type after applying the + operator.
source§

fn add(self, other: &Fe32) -> Fe32

Performs the + operation. Read more
source§

impl Add<Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the + operator.
source§

fn add(self, other: Fe32) -> Fe32

Performs the + operation. Read more
source§

impl Add for Fe32

§

type Output = Fe32

The resulting type after applying the + operator.
source§

fn add(self, other: Fe32) -> Fe32

Performs the + operation. Read more
source§

impl AddAssign for Fe32

source§

fn add_assign(&mut self, other: Fe32)

Performs the += operation. Read more
source§

impl AsRef<u8> for Fe32

source§

fn as_ref(&self) -> &u8

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Fe32

source§

fn clone(&self) -> Fe32

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Fe32

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Fe32

source§

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

Formats the value using the given formatter. Read more
source§

impl Div<&Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the / operator.
source§

fn div(self, other: &Fe32) -> Fe32

Performs the / operation. Read more
source§

impl Div<&Fe32> for Fe32

§

type Output = Fe32

The resulting type after applying the / operator.
source§

fn div(self, other: &Fe32) -> Fe32

Performs the / operation. Read more
source§

impl Div<Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the / operator.
source§

fn div(self, other: Fe32) -> Fe32

Performs the / operation. Read more
source§

impl Div for Fe32

§

type Output = Fe32

The resulting type after applying the / operator.
source§

fn div(self, other: Fe32) -> Fe32

Performs the / operation. Read more
source§

impl DivAssign for Fe32

source§

fn div_assign(&mut self, other: Fe32)

Performs the /= operation. Read more
source§

impl From<Fe32> for u8

source§

fn from(v: Fe32) -> u8

Converts to this type from the input type.
source§

impl Hash for Fe32

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul<&Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the * operator.
source§

fn mul(self, other: &Fe32) -> Fe32

Performs the * operation. Read more
source§

impl Mul<&Fe32> for Fe32

§

type Output = Fe32

The resulting type after applying the * operator.
source§

fn mul(self, other: &Fe32) -> Fe32

Performs the * operation. Read more
source§

impl Mul<Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the * operator.
source§

fn mul(self, other: Fe32) -> Fe32

Performs the * operation. Read more
source§

impl Mul for Fe32

§

type Output = Fe32

The resulting type after applying the * operator.
source§

fn mul(self, other: Fe32) -> Fe32

Performs the * operation. Read more
source§

impl MulAssign for Fe32

source§

fn mul_assign(&mut self, other: Fe32)

Performs the *= operation. Read more
source§

impl PartialEq for Fe32

source§

fn eq(&self, other: &Fe32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Sub<&Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the - operator.
source§

fn sub(self, other: &Fe32) -> Fe32

Performs the - operation. Read more
source§

impl Sub<&Fe32> for Fe32

§

type Output = Fe32

The resulting type after applying the - operator.
source§

fn sub(self, other: &Fe32) -> Fe32

Performs the - operation. Read more
source§

impl Sub<Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the - operator.
source§

fn sub(self, other: Fe32) -> Fe32

Performs the - operation. Read more
source§

impl Sub for Fe32

§

type Output = Fe32

The resulting type after applying the - operator.
source§

fn sub(self, other: Fe32) -> Fe32

Performs the - operation. Read more
source§

impl SubAssign for Fe32

source§

fn sub_assign(&mut self, other: Fe32)

Performs the -= operation. Read more
source§

impl TryFrom<i128> for Fe32

source§

fn try_from(value: i128) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<i16> for Fe32

source§

fn try_from(value: i16) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<i32> for Fe32

source§

fn try_from(value: i32) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<i64> for Fe32

source§

fn try_from(value: i64) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<i8> for Fe32

source§

fn try_from(value: i8) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<u128> for Fe32

source§

fn try_from(value: u128) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<u16> for Fe32

source§

fn try_from(value: u16) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<u32> for Fe32

source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<u64> for Fe32

source§

fn try_from(value: u64) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl TryFrom<u8> for Fe32

source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Tries to create an Fe32 type from a signed source number type.

§Errors

Returns an error if value is outside of the range of an Fe32.

§

type Error = TryFromError

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

impl Copy for Fe32

source§

impl Eq for Fe32

source§

impl StructuralPartialEq for Fe32

Auto Trait Implementations§

§

impl RefUnwindSafe for Fe32

§

impl Send for Fe32

§

impl Sync for Fe32

§

impl Unpin for Fe32

§

impl UnwindSafe for Fe32

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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>,

§

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.