Queryable

Trait Queryable 

Source
pub trait Queryable:
    Endpoint
    + Clone
    + 'static {
    type Return: DeserializeOwned + Send + Sync + Clone + 'static;

    // Provided method
    fn query(
        base_url: &str,
        request_executor: &Client,
        language: Language,
    ) -> impl Future<Output = Result<Self::Return, Error>> + Send { ... }
}
Expand description

Marks a struct as Queryable.

Comes with a default implementation that works universally.

Required Associated Types§

Source

type Return: DeserializeOwned + Send + Sync + Clone + 'static

The Type returned by the query.

Provided Methods§

Source

fn query( base_url: &str, request_executor: &Client, language: Language, ) -> impl Future<Output = Result<Self::Return, Error>> + Send

Queries a model and returns an instance of itself.

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.

Implementors§