Struct dce_router::request::Request
source · pub struct Request<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> Request<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> Request<Raw, ReqDto, Req, Resp, RespDto>where
Raw: RawRequest + Debug + 'static,
ReqDto: 'static,
Req: From<ReqDto> + 'static,
Resp: Into<RespDto> + 'static,
RespDto: 'static,
pub fn api(&self) -> &Api<Raw, ReqDto, Req, Resp, RespDto>
pub fn params(&self) -> &HashMap<&'static str, PathParam>
pub fn param(&self, key: &str) -> DceResult<&PathParam>
pub fn context(&self) -> &HashMap<String, Box<dyn Any + Send>>
pub fn raw(&self) -> &Raw
pub fn rpi(&self) -> &Raw::Rpi
pub fn rpi_mut(&mut self) -> &mut Raw::Rpi
pub async fn req(&mut self) -> DceResult<Req>
pub fn status( self, status: bool, data: Option<Resp>, message: Option<String>, code: isize ) -> DceResult<Option<Raw::Resp>>
pub fn success(self, data: Option<Resp>) -> DceResult<Option<Raw::Resp>>
pub fn fail( self, message: Option<String>, code: isize ) -> DceResult<Option<Raw::Resp>>
pub fn resp(self, resp: Resp) -> DceResult<Option<Raw::Resp>>
pub fn end(self, resp: Option<Resp>) -> DceResult<Option<Raw::Resp>>
pub fn pack_resp(self, resp: Serialized) -> DceResult<Option<Raw::Resp>>
pub fn raw_resp(self, resp: Raw::Resp) -> DceResult<Option<Raw::Resp>>
pub fn parse_api_method_and_extras( prop_tuples: Vec<(&'static str, Box<dyn Any + Send + Sync>)> ) -> (Option<Box<dyn Method<Raw::Rpi> + Send + Sync>>, HashMap<&'static str, Box<dyn Any + Send + Sync>>)
pub fn new( api: &'static Api<Raw, ReqDto, Req, Resp, RespDto>, context: RequestContext<Raw> ) -> Request<Raw, ReqDto, Req, Resp, RespDto>
Trait Implementations§
source§impl<Raw, ReqDto, Req, Resp, RespDto> RequestTrait for Request<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> RequestTrait for Request<Raw, ReqDto, Req, Resp, RespDto>where
Raw: RawRequest + Debug + 'static,
ReqDto: 'static,
Req: From<ReqDto> + 'static,
Resp: Into<RespDto> + 'static,
RespDto: 'static,
Auto Trait Implementations§
impl<Raw, ReqDto, Req, Resp, RespDto> !RefUnwindSafe for Request<Raw, ReqDto, Req, Resp, RespDto>
impl<Raw, ReqDto, Req, Resp, RespDto> Send for Request<Raw, ReqDto, Req, Resp, RespDto>
impl<Raw, ReqDto, Req, Resp, RespDto> !Sync for Request<Raw, ReqDto, Req, Resp, RespDto>
impl<Raw, ReqDto, Req, Resp, RespDto> Unpin for Request<Raw, ReqDto, Req, Resp, RespDto>where
Raw: Unpin,
impl<Raw, ReqDto, Req, Resp, RespDto> !UnwindSafe for Request<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