tmdb-api 0.9.1

Yet another TMDB client. This one is using async methods.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::borrow::Cow;

use crate::client::Executor;

pub trait Command: Sync {
    type Output: serde::de::DeserializeOwned;

    fn path(&self) -> Cow<'static, str>;
    fn params(&self) -> Vec<(&'static str, Cow<'_, str>)>;

    fn execute<E: Executor + Send + Sync>(
        &self,
        client: &crate::Client<E>,
    ) -> impl Future<Output = Result<Self::Output, crate::error::Error>> + Send {
        async move { client.execute(self.path().as_ref(), self.params()).await }
    }
}