Struct scrypto::address::AddressBech32Encoder
source · pub struct AddressBech32Encoder {
pub hrp_set: HrpSet,
}
Expand description
Represents an encoder which understands how to encode Scrypto addresses in Bech32.
Fields§
§hrp_set: HrpSet
Implementations§
source§impl AddressBech32Encoder
impl AddressBech32Encoder
pub fn for_simulator() -> AddressBech32Encoder
sourcepub fn new(network: &NetworkDefinition) -> AddressBech32Encoder
pub fn new(network: &NetworkDefinition) -> AddressBech32Encoder
Instantiates a new AddressBech32Encoder with the HRP corresponding to the passed network.
pub fn encode( &self, full_data: &[u8] ) -> Result<String, AddressBech32EncodeError>
sourcepub fn encode_to_fmt<F>(
&self,
fmt: &mut F,
full_data: &[u8]
) -> Result<(), AddressBech32EncodeError>where
F: Write,
pub fn encode_to_fmt<F>(
&self,
fmt: &mut F,
full_data: &[u8]
) -> Result<(), AddressBech32EncodeError>where
F: Write,
Low level method which performs the Bech32 encoding of the data.
Trait Implementations§
source§impl Debug for AddressBech32Encoder
impl Debug for AddressBech32Encoder
source§impl<'a> From<&'a AddressBech32Encoder> for AddressDisplayContext<'a>
impl<'a> From<&'a AddressBech32Encoder> for AddressDisplayContext<'a>
source§fn from(encoder: &'a AddressBech32Encoder) -> AddressDisplayContext<'a>
fn from(encoder: &'a AddressBech32Encoder) -> AddressDisplayContext<'a>
Converts to this type from the input type.
source§impl<'a> Into<ManifestValueDisplayContext<'a>> for &'a AddressBech32Encoder
impl<'a> Into<ManifestValueDisplayContext<'a>> for &'a AddressBech32Encoder
source§fn into(self) -> ManifestValueDisplayContext<'a>
fn into(self) -> ManifestValueDisplayContext<'a>
Converts this type into the (usually inferred) input type.
source§impl<'a> Into<ScryptoValueDisplayContext<'a>> for &'a AddressBech32Encoder
impl<'a> Into<ScryptoValueDisplayContext<'a>> for &'a AddressBech32Encoder
source§fn into(self) -> ScryptoValueDisplayContext<'a>
fn into(self) -> ScryptoValueDisplayContext<'a>
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
impl RefUnwindSafe for AddressBech32Encoder
impl Send for AddressBech32Encoder
impl Sync for AddressBech32Encoder
impl Unpin for AddressBech32Encoder
impl UnwindSafe for AddressBech32Encoder
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more