Struct cosmwasm_std::QuerierWrapper
source · pub struct QuerierWrapper<'a, C: CustomQuery = Empty> { /* private fields */ }
Implementations§
source§impl<'a, C: CustomQuery> QuerierWrapper<'a, C>
impl<'a, C: CustomQuery> QuerierWrapper<'a, C>
pub fn new(querier: &'a dyn Querier) -> Self
sourcepub fn query<U: DeserializeOwned>(
&self,
request: &QueryRequest<C>
) -> StdResult<U>
pub fn query<U: DeserializeOwned>(
&self,
request: &QueryRequest<C>
) -> StdResult<U>
Makes the query and parses the response.
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(
&self,
address: impl Into<String>,
denom: impl Into<String>
) -> StdResult<Coin>
pub fn query_all_balances(
&self,
address: impl Into<String>
) -> StdResult<Vec<Coin>>
pub fn query_wasm_smart<T: DeserializeOwned>(
&self,
contract_addr: impl Into<String>,
msg: &impl Serialize
) -> StdResult<T>
pub fn query_wasm_raw(
&self,
contract_addr: impl Into<String>,
key: impl Into<Binary>
) -> StdResult<Option<Vec<u8>>>
sourcepub fn query_wasm_contract_info(
&self,
contract_addr: impl Into<String>
) -> StdResult<ContractInfoResponse>
pub fn query_wasm_contract_info(
&self,
contract_addr: impl Into<String>
) -> StdResult<ContractInfoResponse>
Given a contract address, query information about that contract.
pub fn query_all_validators(&self) -> StdResult<Vec<Validator>>
pub fn query_validator(
&self,
address: impl Into<String>
) -> StdResult<Option<Validator>>
pub fn query_bonded_denom(&self) -> StdResult<String>
pub fn query_all_delegations(
&self,
delegator: impl Into<String>
) -> StdResult<Vec<Delegation>>
pub fn query_delegation(
&self,
delegator: impl Into<String>,
validator: impl Into<String>
) -> StdResult<Option<FullDelegation>>
Trait Implementations§
source§impl<'a, C: Clone + CustomQuery> Clone for QuerierWrapper<'a, C>
impl<'a, C: Clone + CustomQuery> Clone for QuerierWrapper<'a, C>
source§fn clone(&self) -> QuerierWrapper<'a, C>
fn clone(&self) -> QuerierWrapper<'a, C>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, C: CustomQuery> Deref for QuerierWrapper<'a, C>
impl<'a, C: CustomQuery> Deref for QuerierWrapper<'a, C>
This allows us to use self.raw_query to access the querier. It also allows external callers to access the querier easily.