pub struct Context<Rp: RoutableProtocol + 'static> { /* private fields */ }Implementations§
Source§impl<Rp: RoutableProtocol + Debug + 'static> Context<Rp>
impl<Rp: RoutableProtocol + Debug + 'static> Context<Rp>
pub fn new( router: Arc<Router<Rp>>, rp: Rp, data: HashMap<String, Box<dyn Any + Send>>, ) -> 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<Rp> Freeze for Context<Rp>where
Rp: Freeze,
impl<Rp> !RefUnwindSafe for Context<Rp>
impl<Rp> Send for Context<Rp>where
Rp: Send,
impl<Rp> !Sync for Context<Rp>
impl<Rp> Unpin for Context<Rp>where
Rp: Unpin,
impl<Rp> !UnwindSafe for Context<Rp>
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