Skip to main content

AsyncQuery

Trait AsyncQuery 

Source
pub trait AsyncQuery<C>: DefaultModel
where 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§

Source

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".

Implementors§

Source§

impl<C, E> AsyncQuery<C> for E
where C: AsyncClient + Sync, E: DefaultModel + Sync, E::AccessControl: From<C::AccessLevel>,