Struct dce_router::api::Api
source · pub struct Api<Raw, ReqDto, Req, Resp, RespDto>where
Raw: RawRequest + Debug + 'static,
ReqDto: 'static,
Req: From<ReqDto> + 'static,
Resp: Into<RespDto> + 'static,
RespDto: 'static,{ /* private fields */ }Implementations§
source§impl<Raw, ReqDto, Req, Resp, RespDto> Api<Raw, ReqDto, Req, Resp, RespDto>where
Raw: RawRequest + Debug + 'static,
ReqDto: 'static,
Req: From<ReqDto> + 'static,
Resp: Into<RespDto> + 'static,
RespDto: 'static,
impl<Raw, ReqDto, Req, Resp, RespDto> Api<Raw, ReqDto, Req, Resp, RespDto>where
Raw: RawRequest + Debug + 'static,
ReqDto: 'static,
Req: From<ReqDto> + 'static,
Resp: Into<RespDto> + 'static,
RespDto: 'static,
pub fn new( controller: Controller<Request<Raw, ReqDto, Req, Resp, RespDto>, Raw::Resp>, deserializers: Vec<Box<dyn Deserializer<ReqDto> + Send + Sync>>, serializers: Vec<Box<dyn Serializer<RespDto> + Send + Sync>>, method: Option<Box<dyn Method<Raw::Rpi> + Send + Sync>>, path: &'static str, id: &'static str, omission: bool, redirect: &'static str, name: &'static str, unresponsive: bool, extras: HashMap<&'static str, Box<dyn Any + Send + Sync>> ) -> Self
pub fn controller( &self ) -> &Controller<Request<Raw, ReqDto, Req, Resp, RespDto>, Raw::Resp>
pub fn deserializers(&self) -> &Vec<Box<dyn Deserializer<ReqDto> + Send + Sync>>
pub fn serializers(&self) -> &Vec<Box<dyn Serializer<RespDto> + Send + Sync>>
Trait Implementations§
source§impl<Raw, ReqDto, Req, Resp, RespDto> ApiTrait<Raw> for Api<Raw, ReqDto, Req, Resp, RespDto>
impl<Raw, ReqDto, Req, Resp, RespDto> ApiTrait<Raw> for Api<Raw, ReqDto, Req, Resp, RespDto>
fn method(&self) -> &Option<Box<dyn Method<Raw::Rpi> + Send + Sync>>
fn path(&self) -> &'static str
fn id(&self) -> &'static str
fn omission(&self) -> bool
fn redirect(&self) -> &'static str
fn name(&self) -> &'static str
fn unresponsive(&self) -> bool
fn extras(&self) -> &HashMap<&'static str, Box<dyn Any + Send + Sync>>
fn method_match(&self, raw: &Raw) -> bool
fn call_controller<'async_trait>(
&'static self,
context: RequestContext<Raw>
) -> Pin<Box<dyn Future<Output = DceResult<Option<Raw::Resp>>> + Send + 'async_trait>>where
Self: 'async_trait,
Auto Trait Implementations§
impl<Raw, ReqDto, Req, Resp, RespDto> !RefUnwindSafe for Api<Raw, ReqDto, Req, Resp, RespDto>
impl<Raw, ReqDto, Req, Resp, RespDto> Send for Api<Raw, ReqDto, Req, Resp, RespDto>
impl<Raw, ReqDto, Req, Resp, RespDto> Sync for Api<Raw, ReqDto, Req, Resp, RespDto>
impl<Raw, ReqDto, Req, Resp, RespDto> Unpin for Api<Raw, ReqDto, Req, Resp, RespDto>
impl<Raw, ReqDto, Req, Resp, RespDto> !UnwindSafe for Api<Raw, ReqDto, Req, Resp, RespDto>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more