Trait bech32::ToBase32

source ·
pub trait ToBase32 {
    // Required method
    fn write_base32<W: WriteBase32>(
        &self,
        writer: &mut W
    ) -> Result<(), <W as WriteBase32>::Error>;

    // Provided method
    fn to_base32(&self) -> Vec<u5> { ... }
}
Expand description

A trait for converting a value to a type T that represents a u5 slice.

This trait is the reciprocal of FromBase32.

Required Methods§

source

fn write_base32<W: WriteBase32>( &self, writer: &mut W ) -> Result<(), <W as WriteBase32>::Error>

Encodes Self as base32 and writes it to the supplied writer.

Implementations should not allocate.

Provided Methods§

source

fn to_base32(&self) -> Vec<u5>

Converts Self to a base32 vector.

Implementors§

source§

impl<T: AsRef<[u8]> + ?Sized> ToBase32 for T