Trait AddressCodec

Source
pub trait AddressCodec<P>: Sized {
    type Error;

    // Required methods
    fn encode(&self, params: &P) -> String;
    fn decode(params: &P, address: &str) -> Result<Self, Self::Error>;
}
Expand description

A trait for encoding and decoding Zcash addresses.

Required Associated Types§

Required Methods§

Source

fn encode(&self, params: &P) -> String

Encode a Zcash address.

§Arguments
  • params - The network the address is to be used on.
Source

fn decode(params: &P, address: &str) -> Result<Self, Self::Error>

Decodes a Zcash address from its string representation.

§Arguments
  • params - The network the address is to be used on.
  • address - The string representation of the address.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<P> AddressCodec<P> for PaymentAddress
where P: Parameters,

Source§

type Error = Bech32DecodeError

Source§

fn encode(&self, params: &P) -> String

Source§

fn decode( params: &P, address: &str, ) -> Result<PaymentAddress, Bech32DecodeError>

Source§

impl<P> AddressCodec<P> for TransparentAddress
where P: Parameters,

Source§

type Error = TransparentCodecError

Source§

fn encode(&self, params: &P) -> String

Source§

fn decode( params: &P, address: &str, ) -> Result<TransparentAddress, TransparentCodecError>

Implementors§

Source§

impl<P> AddressCodec<P> for UnifiedAddress
where P: Parameters,