Trait cargo_api::api::Endpoint

source ·
pub trait Endpoint {
    // Required methods
    fn method(&self) -> Method;
    fn endpoint(&self) -> Cow<'static, str>;

    // Provided methods
    fn parameters(&self) -> QueryParams { ... }
    fn body(&self) -> Result<Vec<u8>, BodyError> { ... }
}
Expand description

Http endpoint trait for cargo-api.

§Credits

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

Required Methods§

source

fn method(&self) -> Method

source

fn endpoint(&self) -> Cow<'static, str>

Provided Methods§

Implementations on Foreign Types§

source§

impl<E> Endpoint for &E
where E: Endpoint,

source§

fn method(&self) -> Method

source§

fn endpoint(&self) -> Cow<'static, str>

source§

fn parameters(&self) -> QueryParams

source§

fn body(&self) -> Result<Vec<u8>, BodyError>

Implementors§

source§

impl<'a> Endpoint for Crate<'a>