#[non_exhaustive]pub enum WasmQuery {
Smart {
contract_addr: String,
msg: Binary,
},
Raw {
contract_addr: String,
key: Binary,
},
ContractInfo {
contract_addr: String,
},
CodeInfo {
code_id: u64,
},
RawRange {
contract_addr: String,
start: Option<Binary>,
end: Option<Binary>,
limit: u16,
order: Order,
},
}
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Smart
this queries the public API of another contract at a known address (with known ABI) Return value is whatever the contract returns (caller should know), wrapped in a ContractResult that is JSON encoded.
Raw
this queries the raw kv-store of the contract. returns the raw, unparsed data stored at that key, which may be an empty vector if not present
ContractInfo
Returns a ContractInfoResponse
with metadata on the contract from the runtime
CodeInfo
Returns a CodeInfoResponse
with metadata of the code
RawRange
Queries a range of keys from the storage of a (different) contract,
returning a RawRangeResponse
.
This is a low-level query that allows you to query the storage of another contract. Please keep in mind that the contract you are querying might change its storage layout using migrations, which could break your queries, so it is recommended to only use this for contracts you control.
Fields
start: Option<Binary>
Inclusive start bound. This is the first key you would like to get data for.
If start
is lexicographically greater than or equal to end
,
an empty range is described, mo matter of the order.
end: Option<Binary>
Exclusive end bound. This is the key after the last key you would like to get data for.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WasmQuery
impl<'de> Deserialize<'de> for WasmQuery
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<C: CustomQuery> From<WasmQuery> for QueryRequest<C>
impl<C: CustomQuery> From<WasmQuery> for QueryRequest<C>
Source§impl JsonSchema for WasmQuery
impl JsonSchema for WasmQuery
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl Schemaifier for WasmQuery
impl Schemaifier for WasmQuery
fn visit_schema(visitor: &mut SchemaVisitor) -> DefinitionReference
fn id() -> Identifier
impl Eq for WasmQuery
impl StructuralPartialEq for WasmQuery
Auto Trait Implementations§
impl Freeze for WasmQuery
impl RefUnwindSafe for WasmQuery
impl Send for WasmQuery
impl Sync for WasmQuery
impl Unpin for WasmQuery
impl UnwindSafe for WasmQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more