pub trait CosmwasmEventExt {
Show 24 methods
// Required methods
fn has_attr(&self, key: &str) -> bool;
fn try_map_attr<B>(&self, key: &str, f: impl Fn(&str) -> B) -> Option<B>;
// Provided methods
fn try_json_attr<B: DeserializeOwned>(&self, key: &str) -> Result<Option<B>> { ... }
fn json_attr<B: DeserializeOwned>(&self, key: &str) -> Result<B> { ... }
fn u64_attr(&self, key: &str) -> Result<u64> { ... }
fn try_u64_attr(&self, key: &str) -> Result<Option<u64>> { ... }
fn timestamp_attr(&self, key: &str) -> Result<Timestamp> { ... }
fn try_timestamp_attr(&self, key: &str) -> Result<Option<Timestamp>> { ... }
fn decimal_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<T> { ... }
fn non_zero_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<NonZero<T>> { ... }
fn signed_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<Signed<T>> { ... }
fn number_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<Signed<T>> { ... }
fn try_number_attr<T: UnsignedDecimal>(
&self,
key: &str,
) -> Result<Option<Signed<T>>> { ... }
fn try_decimal_attr<T: UnsignedDecimal>(
&self,
key: &str,
) -> Result<Option<T>> { ... }
fn try_price_base_in_quote(
&self,
key: &str,
) -> Result<Option<PriceBaseInQuote>> { ... }
fn string_attr(&self, key: &str) -> Result<String> { ... }
fn bool_attr(&self, key: &str) -> Result<bool> { ... }
fn direction_attr(&self, key: &str) -> Result<DirectionToBase> { ... }
fn leverage_to_base_attr(&self, key: &str) -> Result<LeverageToBase> { ... }
fn try_leverage_to_base_attr(
&self,
key: &str,
) -> Result<Option<LeverageToBase>> { ... }
fn unchecked_addr_attr(&self, key: &str) -> Result<Addr> { ... }
fn try_unchecked_addr_attr(&self, key: &str) -> Result<Option<Addr>> { ... }
fn map_attr_ok<B>(&self, key: &str, f: impl Fn(&str) -> B) -> Result<B> { ... }
fn map_attr_result<B>(
&self,
key: &str,
f: impl Fn(&str) -> Result<B>,
) -> Result<B> { ... }
}Expand description
Extension trait to add methods to native cosmwasm events
Required Methods§
Provided Methods§
Sourcefn try_json_attr<B: DeserializeOwned>(&self, key: &str) -> Result<Option<B>>
fn try_json_attr<B: DeserializeOwned>(&self, key: &str) -> Result<Option<B>>
Parse the value associated with the key as JSON, if it exists
Sourcefn json_attr<B: DeserializeOwned>(&self, key: &str) -> Result<B>
fn json_attr<B: DeserializeOwned>(&self, key: &str) -> Result<B>
Parse the value associated with the key as JSON
Sourcefn try_u64_attr(&self, key: &str) -> Result<Option<u64>>
fn try_u64_attr(&self, key: &str) -> Result<Option<u64>>
Parse the value associated with the key as a u64, if it exists
Sourcefn timestamp_attr(&self, key: &str) -> Result<Timestamp>
fn timestamp_attr(&self, key: &str) -> Result<Timestamp>
Parse a timestamp attribute
Sourcefn try_timestamp_attr(&self, key: &str) -> Result<Option<Timestamp>>
fn try_timestamp_attr(&self, key: &str) -> Result<Option<Timestamp>>
Parse a timestamp attribute, if it exists
Sourcefn decimal_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<T>
fn decimal_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<T>
Parse an unsigned decimal attribute
Sourcefn non_zero_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<NonZero<T>>
fn non_zero_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<NonZero<T>>
Parse a non-zero (strictly positive) decimal attribute
Sourcefn signed_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<Signed<T>>
fn signed_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<Signed<T>>
Parse a signed decimal attribute
Sourcefn number_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<Signed<T>>
fn number_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<Signed<T>>
Parse a signed decimal attribute
Sourcefn try_number_attr<T: UnsignedDecimal>(
&self,
key: &str,
) -> Result<Option<Signed<T>>>
fn try_number_attr<T: UnsignedDecimal>( &self, key: &str, ) -> Result<Option<Signed<T>>>
Parse an optional signed decimal attribute
Sourcefn try_decimal_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<Option<T>>
fn try_decimal_attr<T: UnsignedDecimal>(&self, key: &str) -> Result<Option<T>>
Parse an optional unsigned decimal attribute
Sourcefn try_price_base_in_quote(&self, key: &str) -> Result<Option<PriceBaseInQuote>>
fn try_price_base_in_quote(&self, key: &str) -> Result<Option<PriceBaseInQuote>>
Parse an optional price
Sourcefn string_attr(&self, key: &str) -> Result<String>
fn string_attr(&self, key: &str) -> Result<String>
Parse a string attribute
Sourcefn direction_attr(&self, key: &str) -> Result<DirectionToBase>
fn direction_attr(&self, key: &str) -> Result<DirectionToBase>
Parse an attribute with a position direction (to base)
Sourcefn leverage_to_base_attr(&self, key: &str) -> Result<LeverageToBase>
fn leverage_to_base_attr(&self, key: &str) -> Result<LeverageToBase>
Parse an attribute with the absolute leverage (to base)
Sourcefn try_leverage_to_base_attr(&self, key: &str) -> Result<Option<LeverageToBase>>
fn try_leverage_to_base_attr(&self, key: &str) -> Result<Option<LeverageToBase>>
Parse an optional attribute with the absolute leverage (to base)
Sourcefn unchecked_addr_attr(&self, key: &str) -> Result<Addr>
fn unchecked_addr_attr(&self, key: &str) -> Result<Addr>
Parse an address attribute without checking validity
Sourcefn try_unchecked_addr_attr(&self, key: &str) -> Result<Option<Addr>>
fn try_unchecked_addr_attr(&self, key: &str) -> Result<Option<Addr>>
Parse an optional address attribute without checking validity
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.