Skip to main content

ResolvedDependencies

Struct ResolvedDependencies 

Source
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<'_>

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> BackgroundExt for T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ResponseExt for T

Source§

fn header( self, name: impl Into<String>, value: impl Into<String>, ) -> WithHeaders<Self>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.