pub struct Address<E>where
    E: Environment,{ /* private fields */ }

Implementations§

§

impl<E> Address<E>where E: Environment,

pub const fn to_group(&self) -> &Group<E>

Returns the address as a group element.

§

impl<E> Address<E>where E: Environment,

pub const fn new(group: Group<E>) -> Address<E>

Initializes an address from a group element.

pub fn zero() -> Address<E>

Initializes a zero address.

Methods from Deref<Target = Group<E>>§

pub fn to_x_coordinate(&self) -> Field<E>

Returns the x-coordinate in the affine coordinates of the group.

pub fn to_xy_coordinates(&self) -> (Field<E>, Field<E>)

Returns the x-coordinate and y-coordinate in the affine coordinates of the group.

pub fn to_y_coordinate(&self) -> Field<E>

Returns the y-coordinate in the affine coordinates of the group.

pub const EDWARDS_A: Field<E> = _

pub const EDWARDS_D: Field<E> = _

pub const MONTGOMERY_A: Field<E> = _

pub const MONTGOMERY_B: Field<E> = _

pub fn mul_by_cofactor(&self) -> Group<E>

Returns self * COFACTOR.

pub fn div_by_cofactor(&self) -> Group<E>

Returns self / COFACTOR.

Trait Implementations§

source§

impl<E: Environment> Cast<Address<E>> for Boolean<E>

source§

fn cast(&self) -> Result<Address<E>>

Casts a Boolean to an Address.

source§

impl<E: Environment> Cast<Address<E>> for Field<E>

source§

fn cast(&self) -> Result<Address<E>>

Casts a Field to an Address.

This operation attempts to recover the group element from the field element, and then constructs an address from the group element.

To cast arbitrary field elements to addresses, use Field::cast_lossy.

source§

impl<E: Environment, I: IntegerType> Cast<Address<E>> for Integer<E, I>

source§

fn cast(&self) -> Result<Address<E>>

Casts an Integer to an Address.

This operation converts the integer to a field element, and then attempts to recover the group element by treating the field element as an x-coordinate. The group element is then converted to an address.

To cast arbitrary integers to addresses, use Integer::cast_lossy.

source§

impl<E: Environment> Cast<Address<E>> for Scalar<E>

source§

fn cast(&self) -> Result<Address<E>>

Casts a Scalar to an Address.

This operation converts the scalar to a field element, and then attempts to recover the group element by treating the field element as an x-coordinate. The group element is then converted to an address.

To cast arbitrary scalars to addresses, use Scalar::cast_lossy.

source§

impl<E: Environment> CastLossy<Address<E>> for Boolean<E>

source§

fn cast_lossy(&self) -> Address<E>

Casts a Boolean to an Address. This is safe because casting from a boolean to any other type is always lossless.

If the boolean is true, the address is the generator of the prime-order subgroup. If the boolean is false, the address is the zero group element.

source§

impl<E: Environment> CastLossy<Address<E>> for Field<E>

source§

fn cast_lossy(&self) -> Address<E>

Casts a Field to an Address.

This operation attempts to recover the group element from the given field, which is then used to construct the address. See the documentation of Field::cast_lossy on the Group type for more details.

source§

impl<E: Environment, I: IntegerType> CastLossy<Address<E>> for Integer<E, I>

source§

fn cast_lossy(&self) -> Address<E>

Casts an Integer to an Address.

This operation converts the integer into a field element, and then attempts to recover the group element to construct the address. See the documentation of Field::cast_lossy on the Group type for more details.

source§

impl<E: Environment> CastLossy<Address<E>> for Scalar<E>

source§

fn cast_lossy(&self) -> Address<E>

Casts a Scalar to an Address.

This operation converts the scalar into a field element, and then attempts to recover the group element to construct the address. See the documentation of Field::cast_lossy on the Group type for more details.

§

impl<E> Clone for Address<E>where E: Clone + Environment,

§

fn clone(&self) -> Address<E>

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<E> Compare for Address<E>where E: Environment,

§

fn is_less_than(&self, other: &Address<E>) -> <Address<E> as Compare>::Output

Returns true if self is less than other.

§

fn is_greater_than(&self, other: &Address<E>) -> <Address<E> as Compare>::Output

Returns true if self is greater than other.

§

fn is_less_than_or_equal( &self, other: &Address<E> ) -> <Address<E> as Compare>::Output

Returns true if self is less than or equal to other.

§

fn is_greater_than_or_equal( &self, other: &Address<E> ) -> <Address<E> as Compare>::Output

Returns true if self is greater than or equal to other.

§

type Output = Boolean<E>

§

impl<E> Debug for Address<E>where E: Environment,

§

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

Formats the value using the given formatter. Read more
§

impl<E> Deref for Address<E>where E: Environment,

§

fn deref(&self) -> &<Address<E> as Deref>::Target

Returns the address as a group element.

§

type Target = Group<E>

The resulting type after dereferencing.
§

impl<'de, E> Deserialize<'de> for Address<E>where E: Environment,

§

fn deserialize<D>( deserializer: D ) -> Result<Address<E>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,

Deserializes an account address from a string or bytes.

§

impl<E> Display for Address<E>where E: Environment,

§

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

Writes an account address as a bech32m string.

§

impl<E> Distribution<Address<E>> for Standardwhere E: Environment,

§

fn sample<R>(&self, rng: &mut R) -> Address<E>where R: Rng + ?Sized,

Generate a random value of T, using rng as the source of randomness.
source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
§

impl<E> Equal for Address<E>where E: Environment,

§

fn is_equal(&self, other: &Address<E>) -> <Address<E> as Equal>::Output

Returns true if self and other are equal.

§

fn is_not_equal(&self, other: &Address<E>) -> <Address<E> as Equal>::Output

Returns true if self and other are not equal.

§

type Output = Boolean<E>

§

impl<E> FromBits for Address<E>where E: Environment,

§

fn from_bits_le(bits_le: &[bool]) -> Result<Address<E>, Error>

Initializes a new address by recovering the x-coordinate of an affine group from a list of little-endian bits.

§

fn from_bits_be(bits_be: &[bool]) -> Result<Address<E>, Error>

Initializes a new address by recovering the x-coordinate of an affine group from a list of big-endian bits.

§

impl<E> FromBytes for Address<E>where E: Environment,

§

fn read_le<R>(reader: R) -> Result<Address<E>, Error>where R: Read,

Reads in an account address from a buffer.

source§

fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where Self: Sized,

Returns Self from a byte array in little-endian order.
§

impl<E> FromField for Address<E>where E: Environment,

§

fn from_field( field: &<Address<E> as FromField>::Field ) -> Result<Address<E>, Error>

Initializes a new address by recovering the x-coordinate of an affine group from a field element.

§

type Field = Field<E>

§

impl<E> FromFields for Address<E>where E: Environment,

§

fn from_fields( fields: &[<Address<E> as FromFields>::Field] ) -> Result<Address<E>, Error>

Initializes a new address by recovering the x-coordinate of an affine group from a field element.

§

type Field = Field<E>

§

impl<E> FromStr for Address<E>where E: Environment,

§

fn from_str(address: &str) -> Result<Address<E>, <Address<E> as FromStr>::Err>

Reads in an account address string.

§

type Err = Error

The associated error which can be returned from parsing.
§

impl<E> Hash for Address<E>where E: Hash + Environment,

§

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<E> Parser for Address<E>where E: Environment,

§

fn parse(string: &str) -> Result<(&str, Address<E>), Err<VerboseError<&str>>>

Parses a string into an address.

§

impl<E> PartialEq for Address<E>where E: PartialEq + Environment,

§

fn eq(&self, other: &Address<E>) -> 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.
§

impl<E> Serialize for Address<E>where E: Environment,

§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,

Serializes an account address into a string or as bytes.

§

impl<E> SizeInBits for Address<E>where E: Environment,

§

fn size_in_bits() -> usize

Returns the address size in bits.

§

impl<E> SizeInBytes for Address<E>where E: Environment,

§

fn size_in_bytes() -> usize

Returns the address size in bytes.

§

impl<E> Ternary for Address<E>where E: Environment,

§

fn ternary( condition: &<Address<E> as Ternary>::Boolean, first: &Address<E>, second: &Address<E> ) -> <Address<E> as Ternary>::Output

Returns first if condition is true, otherwise returns second.

§

type Boolean = Boolean<E>

§

type Output = Address<E>

§

impl<E> ToBits for Address<E>where E: Environment,

§

fn write_bits_le(&self, vec: &mut Vec<bool>)

Outputs the little-endian bit representation of self.to_x_coordinate() without trailing zeros.

§

fn write_bits_be(&self, vec: &mut Vec<bool>)

Outputs the big-endian bit representation of self.to_x_coordinate() without leading zeros.

source§

fn to_bits_le(&self) -> Vec<bool>

Returns self as a boolean array in little-endian order.
source§

fn to_bits_be(&self) -> Vec<bool>

Returns self as a boolean array in big-endian order.
source§

fn num_bits() -> Option<usize>

An optional indication of how many bits an object can be represented with.
§

impl<E> ToBytes for Address<E>where E: Environment,

§

fn write_le<W>(&self, writer: W) -> Result<(), Error>where W: Write,

Writes an account address to a buffer.

source§

fn to_bytes_le(&self) -> Result<Vec<u8>, Error>where Self: Sized,

Returns self as a byte array in little-endian order.
§

impl<E> ToField for Address<E>where E: Environment,

§

fn to_field(&self) -> Result<<Address<E> as ToField>::Field, Error>

Returns the address as a field element.

§

type Field = Field<E>

§

impl<E> ToFields for Address<E>where E: Environment,

§

fn to_fields(&self) -> Result<Vec<<Address<E> as ToFields>::Field>, Error>

Returns the address as field elements.

§

type Field = Field<E>

source§

impl<N> TryFrom<&ComputeKey<N>> for Address<N>where N: Network,

source§

fn try_from( compute_key: &ComputeKey<N> ) -> Result<Address<N>, <Address<N> as TryFrom<&ComputeKey<N>>>::Error>

Derives the account address from an account compute key.

§

type Error = Error

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

impl<N> TryFrom<&PrivateKey<N>> for Address<N>where N: Network,

source§

fn try_from( private_key: &PrivateKey<N> ) -> Result<Address<N>, <Address<N> as TryFrom<&PrivateKey<N>>>::Error>

Derives the account address from an account private key.

§

type Error = Error

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

impl<N> TryFrom<&ViewKey<N>> for Address<N>where N: Network,

source§

fn try_from( view_key: &ViewKey<N> ) -> Result<Address<N>, <Address<N> as TryFrom<&ViewKey<N>>>::Error>

Derives the account address from an account view key.

§

type Error = Error

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

impl<N> TryFrom<ComputeKey<N>> for Address<N>where N: Network,

source§

fn try_from( compute_key: ComputeKey<N> ) -> Result<Address<N>, <Address<N> as TryFrom<ComputeKey<N>>>::Error>

Derives the account address from an account compute key.

§

type Error = Error

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

impl<N> TryFrom<PrivateKey<N>> for Address<N>where N: Network,

source§

fn try_from( private_key: PrivateKey<N> ) -> Result<Address<N>, <Address<N> as TryFrom<PrivateKey<N>>>::Error>

Derives the account address from an account private key.

§

type Error = Error

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

impl<N> TryFrom<ViewKey<N>> for Address<N>where N: Network,

source§

fn try_from( view_key: ViewKey<N> ) -> Result<Address<N>, <Address<N> as TryFrom<ViewKey<N>>>::Error>

Derives the account address from an account view key.

§

type Error = Error

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

impl<E> TypeName for Address<E>where E: Environment,

§

fn type_name() -> &'static str

Returns the type name as a string.

§

impl<E> Visibility for Address<E>where E: Environment,

§

fn size_in_fields(&self) -> Result<u16, Error>

Returns the number of field elements to encode self.

§

type Boolean = Boolean<E>

§

impl<E> AddressTrait for Address<E>where E: Environment,

§

impl<E> Copy for Address<E>where E: Copy + Environment,

§

impl<E> Eq for Address<E>where E: Eq + Environment,

§

impl<E> StructuralEq for Address<E>where E: Environment,

§

impl<E> StructuralPartialEq for Address<E>where E: Environment,

Auto Trait Implementations§

§

impl<E> RefUnwindSafe for Address<E>where <E as Environment>::Projective: RefUnwindSafe,

§

impl<E> Send for Address<E>

§

impl<E> Sync for Address<E>

§

impl<E> Unpin for Address<E>where <E as Environment>::Projective: Unpin,

§

impl<E> UnwindSafe for Address<E>where <E as Environment>::Projective: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,

source§

fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,

§

impl<Q, K> Equivalent<K> for Qwhere 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
§

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

§

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

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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 Twhere 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.
source§

impl<T> Uniform for Twhere Standard: Distribution<T>,

source§

fn rand<R>(rng: &mut R) -> Twhere R: Rng + ?Sized,

Samples a random value from a uniform distribution.
§

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

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,