ToBech32Ext

Trait ToBech32Ext 

Source
pub trait ToBech32Ext: Sized {
    // Required methods
    fn try_to_bech32(self, hrp: impl AsRef<str>) -> Result<Bech32Address, Error>;
    fn to_bech32(self, hrp: Hrp) -> Bech32Address;
    fn to_bech32_unchecked(self, hrp: impl AsRef<str>) -> Bech32Address;
}
Expand description

Trait extension to convert to bech32.

Required Methods§

Source

fn try_to_bech32(self, hrp: impl AsRef<str>) -> Result<Bech32Address, Error>

Try to encode this address to a bech32 string with the given Human Readable Part as prefix.

Source

fn to_bech32(self, hrp: Hrp) -> Bech32Address

Encodes this address to a bech32 string with the given Human Readable Part as prefix.

Source

fn to_bech32_unchecked(self, hrp: impl AsRef<str>) -> Bech32Address

Encodes this address to a bech32 string with the given Human Readable Part as prefix without checking validity.

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.

Implementors§