Struct cosmwasm_std::QuerierWrapper[][src]

pub struct QuerierWrapper<'a>(_);

Implementations

impl<'a> QuerierWrapper<'a>[src]

pub fn new(querier: &'a dyn Querier) -> Self[src]

pub fn query<T: DeserializeOwned>(
    &self,
    request: &QueryRequest<Empty>
) -> StdResult<T>
[src]

query is a shorthand for custom_query when we are not using a custom type, this allows us to avoid specifying “Empty” in all the type definitions.

pub fn custom_query<C: CustomQuery, U: DeserializeOwned>(
    &self,
    request: &QueryRequest<C>
) -> StdResult<U>
[src]

Makes the query and parses the response. Also handles custom queries, so you need to specify the custom query type in the function parameters. If you are no using a custom query, just use query for easier interface.

Any error (System Error, Error or called contract, or Parse Error) are flattened into one level. Only use this if you don’t need to check the SystemError eg. If you don’t differentiate between contract missing and contract returned error

pub fn query_balance<U: Into<String>, V: Into<String>>(
    &self,
    address: U,
    denom: V
) -> StdResult<Coin>
[src]

pub fn query_all_balances<U: Into<String>>(
    &self,
    address: U
) -> StdResult<Vec<Coin>>
[src]

pub fn query_wasm_smart<T: DeserializeOwned, U: Serialize, V: Into<String>>(
    &self,
    contract_addr: V,
    msg: &U
) -> StdResult<T>
[src]

pub fn query_wasm_raw<T: Into<String>, U: Into<Binary>>(
    &self,
    contract_addr: T,
    key: U
) -> StdResult<Option<Vec<u8>>>
[src]

Trait Implementations

impl<'a> Clone for QuerierWrapper<'a>[src]

impl<'a> Copy for QuerierWrapper<'a>[src]

impl<'a> Deref for QuerierWrapper<'a>[src]

This allows us to use self.raw_query to access the querier. It also allows external callers to access the querier easily.

type Target = dyn Querier + 'a

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for QuerierWrapper<'a>

impl<'a> !Send for QuerierWrapper<'a>

impl<'a> !Sync for QuerierWrapper<'a>

impl<'a> Unpin for QuerierWrapper<'a>

impl<'a> !UnwindSafe for QuerierWrapper<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.