pub trait AsyncQuery<C>: DefaultModelwhere
C: AsyncClient,{
// Required method
fn query_async<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 C,
) -> Pin<Box<dyn Future<Output = Result<Self::Model, ApiError<C::Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
A trait which represents a asynchronous query which may be made to a Traduora client.
The returned model should be a full representation of the data that this
endpoint can return. For more fine-grained control of the deserialized model,
see AsyncCustomQuery.
Required Methods§
Sourcefn query_async<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 C,
) -> Pin<Box<dyn Future<Output = Result<Self::Model, ApiError<C::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_async<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 C,
) -> Pin<Box<dyn Future<Output = Result<Self::Model, ApiError<C::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform the query against the client asynchronously.
§Errors
This method returns an error if
- fails to prepare the request.
- the request could not be sent to the server.
- the server returns a non-success status code.
- the returned JSON fails to deserialize.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".