Struct cosmwasm_std::QuerierWrapper
source · [−]pub struct QuerierWrapper<'a, C: CustomQuery = Empty> { /* private fields */ }
Implementations
sourceimpl<'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>>>
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
sourceimpl<'a, C: Clone + CustomQuery> Clone for QuerierWrapper<'a, C>
impl<'a, C: Clone + CustomQuery> Clone for QuerierWrapper<'a, C>
sourcefn clone(&self) -> QuerierWrapper<'a, C>
fn clone(&self) -> QuerierWrapper<'a, C>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'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.
impl<'a, C: CustomQuery> Copy for QuerierWrapper<'a, C>
Auto Trait Implementations
impl<'a, C = Empty> !RefUnwindSafe for QuerierWrapper<'a, C>
impl<'a, C = Empty> !Send for QuerierWrapper<'a, C>
impl<'a, C = Empty> !Sync for QuerierWrapper<'a, C>
impl<'a, C> Unpin for QuerierWrapper<'a, C> where
C: Unpin,
impl<'a, C = Empty> !UnwindSafe for QuerierWrapper<'a, C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more