pub struct ResolvedDependencies<'values> { /* private fields */ }Expand description
Slot-based dependency values visible to one operation handler.
Slots are compiled when the application is built. Calling Self::get
performs one bounds check and one safe type check; it never looks up a type
name or hashes a key on the request path.
Implementations§
Source§impl ResolvedDependencies<'_>
impl ResolvedDependencies<'_>
Sourcepub fn get<T: 'static>(
&self,
index: usize,
) -> Result<Depends<T>, DependencyError>
pub fn get<T: 'static>( &self, index: usize, ) -> Result<Depends<T>, DependencyError>
Reads a typed dependency from the handler’s compiled argument slot.
§Errors
Returns an internal dependency error if generated metadata and the compiled plan disagree.
Sourcepub fn get_cloned<T: Clone + 'static>(
&self,
index: usize,
) -> Result<T, DependencyError>
pub fn get_cloned<T: Clone + 'static>( &self, index: usize, ) -> Result<T, DependencyError>
Clones a dependency handle directly into a handler argument.
§Errors
Returns an internal dependency error if generated metadata and the compiled plan disagree.
Auto Trait Implementations§
impl<'values> !RefUnwindSafe for ResolvedDependencies<'values>
impl<'values> !Send for ResolvedDependencies<'values>
impl<'values> !Sync for ResolvedDependencies<'values>
impl<'values> !UnwindSafe for ResolvedDependencies<'values>
impl<'values> Freeze for ResolvedDependencies<'values>
impl<'values> Unpin for ResolvedDependencies<'values>
impl<'values> UnsafeUnpin for ResolvedDependencies<'values>
Blanket Implementations§
Source§impl<T> BackgroundExt for T
impl<T> BackgroundExt for T
fn background(self, task: BackgroundTask) -> Background<Self>
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