Trait Endpoint

Source
pub trait Endpoint {
    type Data;
    type Error: Error;

    // Required methods
    fn method() -> Method;
    fn path(&self) -> Cow<'static, str>;
    fn get_data<'async_trait>(
        res: Response,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Data, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;

    // Provided method
    fn body(&self) -> Result<Option<Vec<u8>>, Self::Error> { ... }
}

Required Associated Types§

Required Methods§

Source

fn method() -> Method

Source

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

Source

fn get_data<'async_trait>( res: Response, ) -> Pin<Box<dyn Future<Output = Result<Self::Data, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Provided Methods§

Source

fn body(&self) -> Result<Option<Vec<u8>>, Self::Error>

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§