snarkvm_console_types_integers

Trait FromBase32

Source
pub trait FromBase32: Sized {
    type Err;

    // Required method
    fn from_base32(b32: &[u5]) -> Result<Self, Self::Err>;
}
Expand description

Parse/convert base32 slice to Self. It is the reciprocal of ToBase32.

Required Associated Types§

Source

type Err

The associated error which can be returned from parsing (e.g. because of bad padding).

Required Methods§

Source

fn from_base32(b32: &[u5]) -> Result<Self, Self::Err>

Convert a base32 slice to Self.

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 FromBase32 for Vec<u8>

Source§

fn from_base32(b32: &[u5]) -> Result<Vec<u8>, <Vec<u8> as FromBase32>::Err>

Convert base32 to base256, removes null-padding if present, returns Err(Error::InvalidPadding) if padding bits are unequal 0

Source§

type Err = Error

Implementors§