[−][src]Struct subtle_encoding::bech32::Bech32
Bech32 encoder/decoder
Methods
impl Bech32
[src]
pub fn lower_case() -> Self
[src]
Decode lower case Bech32 strings
pub fn upper_case() -> Self
[src]
Decode upper case Bech32 strings
pub fn new(charset: [char; 32], separator: char) -> Self
[src]
Create a Bech32
encoder with the given separator character
Panics if the separator character is invalid
pub fn separator(&self) -> char
[src]
Return the separator character currently in use
pub fn encode<S, D>(&self, hrp: S, data: D) -> String where
S: AsRef<str>,
D: AsRef<[u8]>,
[src]
S: AsRef<str>,
D: AsRef<[u8]>,
Encode a bech32 string from a human-readable part (hrp) and binary data
pub fn decode<S>(&self, encoded: S) -> Result<(String, Vec<u8>), Error> where
S: AsRef<str>,
[src]
S: AsRef<str>,
Decode a bech32 string to a human-readable part (HRP) and binary data
Trait Implementations
Auto Trait Implementations
impl Unpin for Bech32
impl Send for Bech32
impl Sync for Bech32
impl UnwindSafe for Bech32
impl RefUnwindSafe for Bech32
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,