Trait dce_router::protocol::RoutableProtocol
source · 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§
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>
Object Safety§
This trait is not object safe.