Trait cargo_api::api::Query

source ·
pub trait Query<T, C: Client> {
    // Required method
    fn query(&self, client: &C) -> Result<T, ApiError<C::Error>>;
}
Expand description

Query trait for ‘cargo-api’

§Credits

Inspired by Ben Boeckel’s blog post titled “Designing Rust bindings for REST APIs”.

Required Methods§

source

fn query(&self, client: &C) -> Result<T, ApiError<C::Error>>

Implementors§

source§

impl<E, C> Query<Value, C> for Json<E>
where E: Endpoint, C: Client,

source§

impl<E, T, C> Query<T, C> for E
where E: Endpoint, T: DeserializeOwned, C: Client,