pub struct Request<'a, Rp, ReqDto, RespDto>{ /* private fields */ }Implementations§
Source§impl<'a, Rp, ReqDto, RespDto> Request<'a, Rp, ReqDto, RespDto>
impl<'a, Rp, ReqDto, RespDto> Request<'a, Rp, ReqDto, RespDto>
pub async fn req<Req: From<ReqDto>>(&mut self) -> DceResult<Req>
pub async fn dto(&mut self) -> DceResult<ReqDto>
pub fn status<Resp: Into<RespDto>>( self, status: bool, data: Option<Resp>, message: Option<String>, code: isize, ) -> DceResult<Option<Response<Rp::Resp>>>
pub fn success( self, data: Option<RespDto>, ) -> DceResult<Option<Response<Rp::Resp>>>
pub fn fail( self, message: Option<String>, code: isize, ) -> DceResult<Option<Response<Rp::Resp>>>
pub fn resp<Resp: Into<RespDto>>( self, resp: Resp, ) -> DceResult<Option<Response<Rp::Resp>>>
pub fn end(self, resp: Option<RespDto>) -> DceResult<Option<Response<Rp::Resp>>>
pub fn pack( self, serialized: Serialized, ) -> DceResult<Option<Response<Rp::Resp>>>
pub fn raw_resp(self, resp: Rp::Resp) -> DceResult<Option<Response<Rp::Resp>>>
pub fn new( api: &'static Api<Rp, ReqDto, RespDto>, context: &'a mut Context<Rp>, ) -> Request<'a, Rp, ReqDto, RespDto>
Methods from Deref<Target = Context<Rp>>§
pub fn router(&self) -> &Arc<Router<Rp>>
pub fn api(&self) -> Option<&'static (dyn ApiTrait<Rp> + Send + Sync)>
pub fn rp(&self) -> &Rp
pub fn rp_mut(&mut self) -> &mut Rp
pub fn take_rp(&mut self) -> Option<Rp>
pub fn params(&self) -> &HashMap<&'static str, PathParam>
pub fn param(&self, key: &str) -> DceResult<&PathParam>
pub fn suffix(&mut self) -> &'static str
pub fn data(&self) -> &HashMap<String, Box<dyn Any + Send>>
pub fn put_data(&mut self, key: String, value: Box<dyn Any + Send>)
pub fn get_as<S: 'static>(&self, key: &str) -> DceResult<&S>
pub fn get_as_mut<S: 'static>(&mut self, key: &str) -> DceResult<&mut S>
pub fn set_routed_info( &mut self, api: &'static (dyn ApiTrait<Rp> + Send + Sync), params: HashMap<&'static str, PathParam>, suffix: Option<&'static str>, )
Trait Implementations§
Auto Trait Implementations§
impl<'a, Rp, ReqDto, RespDto> Freeze for Request<'a, Rp, ReqDto, RespDto>
impl<'a, Rp, ReqDto, RespDto> !RefUnwindSafe for Request<'a, Rp, ReqDto, RespDto>
impl<'a, Rp, ReqDto, RespDto> Send for Request<'a, Rp, ReqDto, RespDto>
impl<'a, Rp, ReqDto, RespDto> !Sync for Request<'a, Rp, ReqDto, RespDto>
impl<'a, Rp, ReqDto, RespDto> Unpin for Request<'a, Rp, ReqDto, RespDto>
impl<'a, Rp, ReqDto, RespDto> !UnwindSafe for Request<'a, Rp, ReqDto, 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