[][src]Struct cosmwasm_std::QuerierWrapper

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<HumanAddr>>(
    &self,
    address: U,
    denom: &str
) -> StdResult<Coin>
[src]

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

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

pub fn query_wasm_raw<T: Into<HumanAddr>, U: Into<Binary>>(
    &self,
    contract: 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>[src]

impl<'a> !Send for QuerierWrapper<'a>[src]

impl<'a> !Sync for QuerierWrapper<'a>[src]

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

impl<'a> !UnwindSafe for QuerierWrapper<'a>[src]

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> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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.