Trait canapi::Endpoint[][src]

pub trait Endpoint: Default + Serialize + DeserializeOwned {
    type Id: Display;
    fn endpoint() -> &'static str;

    fn get<F: Fetch>(&self, id: Self::Id) -> Result<Self, Error> { ... }
fn list<F: Fetch>(&self) -> Result<Self, Error> { ... }
fn find<F: Fetch>(&self, query: Self) -> Result<Self, Error> { ... }
fn create<F: Fetch>(&self, new: Self) -> Result<Self, Error> { ... }
fn update<F: Fetch>(&self, id: Self::Id, data: Self) -> Result<Self, Error> { ... }
fn delete<F: Fetch>(&self, id: Self::Id) -> Result<Self, Error> { ... } }

API Endpoint, common to the server and the front

Associated Types

Required Methods

The URL on which this endpoint is mounted.

It should start with a /, and end without.

Provided Methods

Implementors