pub enum Address {
Byron(ByronAddress),
Shelley(ShelleyAddress),
Stake(StakeAddress),
}Expand description
A decoded Cardano address of any type
Variants§
Implementations§
Source§impl Address
impl Address
Sourcepub fn to_bech32(&self) -> Result<String, Error>
pub fn to_bech32(&self) -> Result<String, Error>
Tries to encode an Address into a bech32 string
Sourcepub fn from_bech32(bech32: &str) -> Result<Address, Error>
pub fn from_bech32(bech32: &str) -> Result<Address, Error>
Tries to parse a bech32 value into an Address
pub fn from_bytes(bytes: &[u8]) -> Result<Address, Error>
pub fn from_hex(bytes: &str) -> Result<Address, Error>
Sourcepub fn hrp(&self) -> Result<&'static str, Error>
pub fn hrp(&self) -> Result<&'static str, Error>
Gets the bech32 human-readable-part for this address
Sourcepub fn has_script(&self) -> bool
pub fn has_script(&self) -> bool
Indicates if this is address includes a script hash
Sourcepub fn is_enterprise(&self) -> bool
pub fn is_enterprise(&self) -> bool
Indicates if this is an enterpise address
pub fn to_vec(&self) -> Vec<u8> ⓘ
pub fn to_hex(&self) -> String
Trait Implementations§
Source§impl From<ByronAddress> for Address
impl From<ByronAddress> for Address
Source§fn from(addr: ByronAddress) -> Address
fn from(addr: ByronAddress) -> Address
Converts to this type from the input type.
Source§impl From<ShelleyAddress> for Address
impl From<ShelleyAddress> for Address
Source§fn from(addr: ShelleyAddress) -> Address
fn from(addr: ShelleyAddress) -> Address
Converts to this type from the input type.
Source§impl From<StakeAddress> for Address
impl From<StakeAddress> for Address
Source§fn from(addr: StakeAddress) -> Address
fn from(addr: StakeAddress) -> Address
Converts to this type from the input type.
Source§impl PartialOrd for Address
impl PartialOrd for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin for Address
impl UnwindSafe for Address
Blanket Implementations§
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more