bdk_chain::bitcoin::bech32

Struct Fe32

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

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

Implementations§

§

impl Fe32

pub const Q: Fe32 = _

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

pub const P: Fe32 = _

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

pub const Z: Fe32 = _

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

pub const R: Fe32 = _

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

pub const Y: Fe32 = _

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

pub const _9: Fe32 = _

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

pub const X: Fe32 = _

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

pub const _8: Fe32 = _

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

pub const G: Fe32 = _

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

pub const F: Fe32 = _

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

pub const _2: Fe32 = _

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

pub const T: Fe32 = _

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

pub const V: Fe32 = _

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

pub const D: Fe32 = _

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

pub const W: Fe32 = _

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

pub const _0: Fe32 = _

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

pub const S: Fe32 = _

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

pub const _3: Fe32 = _

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

pub const J: Fe32 = _

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

pub const N: Fe32 = _

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

pub const _5: Fe32 = _

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

pub const _4: Fe32 = _

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

pub const K: Fe32 = _

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

pub const H: Fe32 = _

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

pub const C: Fe32 = _

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

pub const E: Fe32 = _

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

pub const _6: Fe32 = _

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

pub const M: Fe32 = _

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

pub const U: Fe32 = _

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

pub const A: Fe32 = _

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

pub const _7: Fe32 = _

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

pub const L: Fe32 = _

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

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

Iterator over all field elements, in alphabetical order.

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.

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.

pub fn to_char(self) -> char

Converts the field element to a lowercase bech32 character.

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§

§

impl Add<&Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the + operator.
§

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

Performs the + operation. Read more
§

impl Add<&Fe32> for Fe32

§

type Output = Fe32

The resulting type after applying the + operator.
§

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

Performs the + operation. Read more
§

impl Add<Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the + operator.
§

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

Performs the + operation. Read more
§

impl Add for Fe32

§

type Output = Fe32

The resulting type after applying the + operator.
§

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

Performs the + operation. Read more
§

impl AddAssign for Fe32

§

fn add_assign(&mut self, other: Fe32)

Performs the += operation. Read more
§

impl AsRef<u8> for Fe32

§

fn as_ref(&self) -> &u8

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

impl Clone for Fe32

§

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
§

impl Debug for Fe32

§

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

Formats the value using the given formatter. Read more
§

impl Display for Fe32

§

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

Formats the value using the given formatter. Read more
§

impl Div<&Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the / operator.
§

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

Performs the / operation. Read more
§

impl Div<&Fe32> for Fe32

§

type Output = Fe32

The resulting type after applying the / operator.
§

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

Performs the / operation. Read more
§

impl Div<Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the / operator.
§

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

Performs the / operation. Read more
§

impl Div for Fe32

§

type Output = Fe32

The resulting type after applying the / operator.
§

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

Performs the / operation. Read more
§

impl DivAssign for Fe32

§

fn div_assign(&mut self, other: Fe32)

Performs the /= operation. Read more
§

impl From<Fe32> for u8

§

fn from(v: Fe32) -> u8

Converts to this type from the input type.
§

impl From<WitnessVersion> for Fe32

§

fn from(version: WitnessVersion) -> Fe32

Converts to this type from the input type.
§

impl Hash for Fe32

§

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

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
§

impl Mul<&Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the * operator.
§

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

Performs the * operation. Read more
§

impl Mul<&Fe32> for Fe32

§

type Output = Fe32

The resulting type after applying the * operator.
§

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

Performs the * operation. Read more
§

impl Mul<Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the * operator.
§

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

Performs the * operation. Read more
§

impl Mul for Fe32

§

type Output = Fe32

The resulting type after applying the * operator.
§

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

Performs the * operation. Read more
§

impl MulAssign for Fe32

§

fn mul_assign(&mut self, other: Fe32)

Performs the *= operation. Read more
§

impl PartialEq for Fe32

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Sub<&Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the - operator.
§

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

Performs the - operation. Read more
§

impl Sub<&Fe32> for Fe32

§

type Output = Fe32

The resulting type after applying the - operator.
§

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

Performs the - operation. Read more
§

impl Sub<Fe32> for &Fe32

§

type Output = Fe32

The resulting type after applying the - operator.
§

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

Performs the - operation. Read more
§

impl Sub for Fe32

§

type Output = Fe32

The resulting type after applying the - operator.
§

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

Performs the - operation. Read more
§

impl SubAssign for Fe32

§

fn sub_assign(&mut self, other: Fe32)

Performs the -= operation. Read more
§

impl TryFrom<Fe32> for WitnessVersion

§

type Error = TryFromError

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

fn try_from( value: Fe32, ) -> Result<WitnessVersion, <WitnessVersion as TryFrom<Fe32>>::Error>

Performs the conversion.
§

impl TryFrom<i128> for Fe32

§

fn try_from(value: i128) -> Result<Fe32, <Fe32 as TryFrom<i128>>::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.
§

impl TryFrom<i16> for Fe32

§

fn try_from(value: i16) -> Result<Fe32, <Fe32 as TryFrom<i16>>::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.
§

impl TryFrom<i32> for Fe32

§

fn try_from(value: i32) -> Result<Fe32, <Fe32 as TryFrom<i32>>::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.
§

impl TryFrom<i64> for Fe32

§

fn try_from(value: i64) -> Result<Fe32, <Fe32 as TryFrom<i64>>::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.
§

impl TryFrom<i8> for Fe32

§

fn try_from(value: i8) -> Result<Fe32, <Fe32 as TryFrom<i8>>::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.
§

impl TryFrom<u128> for Fe32

§

fn try_from(value: u128) -> Result<Fe32, <Fe32 as TryFrom<u128>>::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.
§

impl TryFrom<u16> for Fe32

§

fn try_from(value: u16) -> Result<Fe32, <Fe32 as TryFrom<u16>>::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.
§

impl TryFrom<u32> for Fe32

§

fn try_from(value: u32) -> Result<Fe32, <Fe32 as TryFrom<u32>>::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.
§

impl TryFrom<u64> for Fe32

§

fn try_from(value: u64) -> Result<Fe32, <Fe32 as TryFrom<u64>>::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.
§

impl TryFrom<u8> for Fe32

§

fn try_from(value: u8) -> Result<Fe32, <Fe32 as TryFrom<u8>>::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.
§

impl Copy for Fe32

§

impl Eq for Fe32

§

impl StructuralPartialEq for Fe32

Auto Trait Implementations§

§

impl Freeze for Fe32

§

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

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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,

Source§

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§

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

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V