[][src]Trait earth_codec::AddressCodec

pub trait AddressCodec {
    type Error;
    fn encode(
        raw: &[u8],
        hash_type: HashType,
        network: Network
    ) -> Result<String, Self::Error>;
fn decode(s: &str) -> Result<Address, Self::Error>; }

A trait providing an interface for encoding and decoding the Address struct for each address scheme.

Associated Types

type Error

Loading content...

Required methods

fn encode(
    raw: &[u8],
    hash_type: HashType,
    network: Network
) -> Result<String, Self::Error>

Attempt to convert the raw address bytes to a string

fn decode(s: &str) -> Result<Address, Self::Error>

Attempt to convert the address string to bytes

Loading content...

Implementors

impl AddressCodec for Base58Codec[src]

type Error = Base58Error

impl AddressCodec for CashAddrCodec[src]

type Error = CashAddrError

impl AddressCodec for EarthCodec[src]

type Error = EarthError

Loading content...