cosmwasm_std/query/
query_response.rs

1use core::fmt::Debug;
2
3use serde::de::DeserializeOwned;
4
5/// A marker trait for query response types.
6///
7/// Those types have in common that they should be `#[non_exhaustive]` in order
8/// to allow adding fields in a backwards compatible way. In contracts they are
9/// only constructed through deserialization. We want to make it hard for
10/// contract developers to construct those types themselves as this is most likely
11/// not what they should do.
12///
13/// In hosts they are constructed as follows:
14/// - wasmvm: Go types with the same JSON layout
15/// - multi-test/cw-sdk: create a default instance and mutate the fields
16///
17/// This trait is crate-internal and can change any time.
18#[allow(dead_code)] // This is used to statically ensure all the types have a shared set of traits
19pub(crate) trait QueryResponseType: DeserializeOwned + Debug + PartialEq + Clone {}