Struct cosmwasm_std::HumanAddr [−][src]
pub struct HumanAddr(pub String);
HumanAddr is not much more than an alias to String and it does not provide significant safety advantages. With CosmWasm 0.14, we now use String when there was HumanAddr before. There is also the new Addr, which holds a validated immutable human readable address.
Implementations
Trait Implementations
Just like String, HumanAddr is a smart pointer to str.
This implements *human_address
for us, which is not very valuable directly
because str has no known size and cannot be stored in variables. But it allows us to
do &*human_address
, returning a &str
from a &HumanAddr
.
With deref coercions,
this allows us to use &human_address
whenever a &str
is required.
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Implement HumanAddr == &str
Implement str == HumanAddr
, which gives us &str == &HumanAddr
.
Do we really need &HumanAddr comparisons?
Implement &str == HumanAddr
Implement HumanAddr == str
, which gives us &HumanAddr == &str
.
Do we really need &HumanAddr comparisons?
Auto Trait Implementations
impl RefUnwindSafe for HumanAddr
impl UnwindSafe for HumanAddr
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self