pub trait RoutableProtocol:
From<Self::Req>
+ Into<Self::Resp>
+ Deref<Target = Meta<Self::Req, Self::Resp>>
+ DerefMut
+ Debug {
type Req;
type Resp: Debug;
Show 16 methods
// Required methods
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 path(&self) -> &str { ... }
fn id(&self) -> Option<&str> { ... }
fn handle<'async_trait>(
self,
router: Arc<Router<Self>>,
context_data: HashMap<String, Box<dyn Any + Send>>,
) -> Pin<Box<dyn Future<Output = Option<Self::Resp>> + Send + 'async_trait>>
where Self: Send + 'async_trait { ... }
fn api_match(
&self,
apis: &[&'static (dyn ApiTrait<Self> + Send + Sync)],
) -> DceResult<&'static (dyn ApiTrait<Self> + Send + Sync)> { ... }
fn deserializer<'a, ReqDto>(
deserializers: &'a [Box<dyn Deserializer<ReqDto> + Send + Sync>],
_context: &Context<Self>,
) -> DceResult<&'a Box<dyn Deserializer<ReqDto> + Send + Sync>> { ... }
fn serializer<'a, RespDto>(
serializers: &'a [Box<dyn Serializer<RespDto> + Send + Sync>],
_context: &Context<Self>,
) -> DceResult<&'a Box<dyn Serializer<RespDto> + Send + Sync>> { ... }
fn deserialize<ReqDto>(
serializers: &[Box<dyn Deserializer<ReqDto> + Send + Sync>],
seq: Serialized,
context: &Context<Self>,
) -> DceResult<ReqDto> { ... }
fn serialize<RespDto>(
serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>],
dto: Serializable<RespDto>,
context: &Context<Self>,
) -> DceResult<Serialized> { ... }
fn pack_responsible<RespDto: 'static>(
context: &Context<Self>,
serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>],
responsible: Serializable<RespDto>,
) -> DceResult<Option<Response<Self::Resp>>> { ... }
fn parse_api_method_and_extras(
prop_tuples: Vec<(&'static str, Box<dyn Any + Send + Sync>)>,
) -> (Option<Box<dyn Method<Self> + Send + Sync>>, HashMap<&'static str, Box<dyn Any + Send + Sync>>) { ... }
fn parse_api_method(
_prop_mapping: &mut HashMap<&'static str, Box<dyn Any + Send + Sync>>,
) -> Option<Box<dyn Method<Self> + Send + Sync>> { ... }
fn try_print_err(response: &DceResult<()>) { ... }
fn err_into(self, err: DceErr) -> Self::Resp { ... }
fn handle_result(
self,
result: DceResult<()>,
context: &mut Context<Self>,
) -> Option<Self::Resp> { ... }
}Required Associated Types§
Required Methods§
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 path(&self) -> &str
fn id(&self) -> Option<&str>
fn handle<'async_trait>(
self,
router: Arc<Router<Self>>,
context_data: HashMap<String, Box<dyn Any + Send>>,
) -> Pin<Box<dyn Future<Output = Option<Self::Resp>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
fn api_match( &self, apis: &[&'static (dyn ApiTrait<Self> + Send + Sync)], ) -> DceResult<&'static (dyn ApiTrait<Self> + Send + Sync)>
fn deserializer<'a, ReqDto>( deserializers: &'a [Box<dyn Deserializer<ReqDto> + Send + Sync>], _context: &Context<Self>, ) -> DceResult<&'a Box<dyn Deserializer<ReqDto> + Send + Sync>>
fn serializer<'a, RespDto>( serializers: &'a [Box<dyn Serializer<RespDto> + Send + Sync>], _context: &Context<Self>, ) -> DceResult<&'a Box<dyn Serializer<RespDto> + Send + Sync>>
fn deserialize<ReqDto>( serializers: &[Box<dyn Deserializer<ReqDto> + Send + Sync>], seq: Serialized, context: &Context<Self>, ) -> DceResult<ReqDto>
fn serialize<RespDto>( serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>], dto: Serializable<RespDto>, context: &Context<Self>, ) -> DceResult<Serialized>
fn pack_responsible<RespDto: 'static>( context: &Context<Self>, serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>], responsible: Serializable<RespDto>, ) -> DceResult<Option<Response<Self::Resp>>>
fn parse_api_method_and_extras( prop_tuples: Vec<(&'static str, Box<dyn Any + Send + Sync>)>, ) -> (Option<Box<dyn Method<Self> + Send + Sync>>, HashMap<&'static str, Box<dyn Any + Send + Sync>>)
fn parse_api_method( _prop_mapping: &mut HashMap<&'static str, Box<dyn Any + Send + Sync>>, ) -> Option<Box<dyn Method<Self> + Send + Sync>>
fn try_print_err(response: &DceResult<()>)
fn err_into(self, err: DceErr) -> Self::Resp
fn handle_result( self, result: DceResult<()>, context: &mut Context<Self>, ) -> Option<Self::Resp>
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.