Trait AddressCodec

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§

type Error

Required Methods§

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

Encode a Zcash address.

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

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§

§

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

§

type Error = Bech32DecodeError

§

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

§

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

§

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

§

type Error = TransparentCodecError

§

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

§

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

Implementors§

§

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