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