pub struct ZcashAddress { /* private fields */ }
Expand description

A Zcash address.

Implementations

Encodes this Zcash address in its canonical string representation.

This provides the encoded string representation of the address as defined by the Zcash protocol specification and/or ZIP 316. The Display implementation can also be used to produce this encoding using address.to_string().

Attempts to parse the given string as a Zcash address.

This simply calls s.parse(), leveraging the FromStr implementation.

Errors
  • If the parser can detect that the string must contain an address encoding used by Zcash, ParseError::InvalidEncoding will be returned if any subsequent part of that encoding is invalid.

  • In all other cases, ParseError::NotZcash will be returned on failure.

Examples
use zcash_address::ZcashAddress;

let encoded = "zs1z7rejlpsa98s2rrrfkwmaxu53e4ue0ulcrw0h4x5g8jl04tak0d3mm47vdtahatqrlkngh9sly";
let addr = ZcashAddress::try_from_encoded(&encoded);
assert_eq!(encoded.parse(), addr);

Converts this address into another type.

convert can convert into any type that implements the FromAddress trait. This enables ZcashAddress to be used as a common parsing and serialization interface for Zcash addresses, while delegating operations on those addresses (such as constructing transactions) to downstream crates.

If you want to get the encoded string for this address, use the encode method or the Display implementation via address.to_string() instead.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Attempts to parse the given string as a Zcash address.

The associated error which can be returned from parsing.

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.