pub trait Query:
Sized
+ Send
+ Sync {
type Args: Serialize + Clone + Send + Sync;
type Result: DeserializeOwned + Send + Sync;
// Required methods
fn template_name() -> &'static str;
fn args(&self) -> &Self::Args;
fn from_result(result: Self::Result) -> Self;
}Expand description
Trait for defining parameterized queries
Queries allow executing specific operations against the test database.
Required Associated Types§
Sourcetype Result: DeserializeOwned + Send + Sync
type Result: DeserializeOwned + Send + Sync
The type of result returned by the query
Required Methods§
Sourcefn template_name() -> &'static str
fn template_name() -> &'static str
The name of this query template
Sourcefn from_result(result: Self::Result) -> Self
fn from_result(result: Self::Result) -> Self
Create an instance from the query result
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.