Trait dce_router::request::RawRequest
source · pub trait RawRequest {
type Rpi: RoutableProtocol + Debug;
type Req: 'static;
type Resp: Debug + 'static;
Show 14 methods
// Required methods
fn new(proto: Self::Rpi) -> Self;
fn path(&self) -> &str;
fn raw(&self) -> &Self::Rpi;
fn raw_mut(&mut self) -> &mut Self::Rpi;
fn data<'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_response(self, serialized: Serialized) -> DceResult<Self::Resp>
where Self: Sized;
// Provided methods
fn pack_responsible<RespDto: 'static>(
self,
serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>],
responsible: Serializable<RespDto>
) -> DceResult<Option<Self::Resp>>
where Self: Sized { ... }
fn api_match<Raw: RawRequest>(
raw: &Raw,
apis: &[&'static (dyn ApiTrait<Raw> + Send + Sync)]
) -> DceResult<&'static (dyn ApiTrait<Raw> + Send + Sync)> { ... }
fn parse_api_method(
_prop_mapping: &mut HashMap<&'static str, Box<dyn Any + Send + Sync>>
) -> Option<Box<dyn Method<Self::Rpi> + Send + Sync>> { ... }
fn route<'async_trait>(
context: RequestContext<Self>
) -> Pin<Box<dyn Future<Output = (Option<bool>, DceResult<Option<Self::Resp>>)> + Send + 'async_trait>>
where Self: Debug + Sized + Send + 'async_trait { ... }
fn get_input_serializer<ReqDto>(
deserializers: &[Box<dyn Deserializer<ReqDto> + Send + Sync>]
) -> &Box<dyn Deserializer<ReqDto> + Send + Sync> { ... }
fn get_output_serializer<RespDto>(
serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>]
) -> &Box<dyn Serializer<RespDto> + Send + Sync> { ... }
fn deserialize<ReqDto>(
serializers: &[Box<dyn Deserializer<ReqDto> + Send + Sync>],
raw: Serialized
) -> DceResult<ReqDto> { ... }
fn serialize<RespDto>(
serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>],
dto: Serializable<RespDto>
) -> DceResult<Serialized> { ... }
}Expand description
Package for raw request data and agent for protocol
Required Associated Types§
Required Methods§
fn new(proto: Self::Rpi) -> Self
fn path(&self) -> &str
fn raw(&self) -> &Self::Rpi
fn raw_mut(&mut self) -> &mut Self::Rpi
fn data<'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_response(self, serialized: Serialized) -> DceResult<Self::Resp>where
Self: Sized,
Provided Methods§
fn pack_responsible<RespDto: 'static>(
self,
serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>],
responsible: Serializable<RespDto>
) -> DceResult<Option<Self::Resp>>where
Self: Sized,
fn api_match<Raw: RawRequest>( raw: &Raw, apis: &[&'static (dyn ApiTrait<Raw> + Send + Sync)] ) -> DceResult<&'static (dyn ApiTrait<Raw> + Send + Sync)>
fn parse_api_method( _prop_mapping: &mut HashMap<&'static str, Box<dyn Any + Send + Sync>> ) -> Option<Box<dyn Method<Self::Rpi> + Send + Sync>>
fn route<'async_trait>( context: RequestContext<Self> ) -> Pin<Box<dyn Future<Output = (Option<bool>, DceResult<Option<Self::Resp>>)> + Send + 'async_trait>>
fn get_input_serializer<ReqDto>( deserializers: &[Box<dyn Deserializer<ReqDto> + Send + Sync>] ) -> &Box<dyn Deserializer<ReqDto> + Send + Sync>
fn get_output_serializer<RespDto>( serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>] ) -> &Box<dyn Serializer<RespDto> + Send + Sync>
fn deserialize<ReqDto>( serializers: &[Box<dyn Deserializer<ReqDto> + Send + Sync>], raw: Serialized ) -> DceResult<ReqDto>
fn serialize<RespDto>( serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>], dto: Serializable<RespDto> ) -> DceResult<Serialized>
Object Safety§
This trait is not object safe.