pub trait RoutableProtocol: From<Self::Req> + Into<Self::Resp> {
    type Req;
    type Resp: Debug;

    // Required methods
    fn path(&self) -> &str;
    fn body<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = DceResult<Serialized>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn pack_resp(self, serialized: Serialized) -> Self::Resp;

    // Provided methods
    fn id(&self) -> Option<&str> { ... }
    fn try_print_err(response: &DceResult<Option<Self::Resp>>) { ... }
    fn err_into(self, code: isize, message: String) -> Self::Resp { ... }
    fn handle_result(
        self,
        (unresponsive, response): (Option<bool>, DceResult<Option<Self::Resp>>)
    ) -> Option<Self::Resp> { ... }
}

Required Associated Types§

Required Methods§

source

fn path(&self) -> &str

source

fn body<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = DceResult<Serialized>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn pack_resp(self, serialized: Serialized) -> Self::Resp

Provided Methods§

source

fn id(&self) -> Option<&str>

source

fn try_print_err(response: &DceResult<Option<Self::Resp>>)

source

fn err_into(self, code: isize, message: String) -> Self::Resp

source

fn handle_result( self, (unresponsive, response): (Option<bool>, DceResult<Option<Self::Resp>>) ) -> Option<Self::Resp>

Object Safety§

This trait is not object safe.

Implementors§