Struct runtime_injector_actix::Arg [−][src]
Expand description
Allows custom pre-defined values to be passed as arguments to services.
Example
use runtime_injector::{Arg, Injector, IntoTransient, WithArg}; struct Foo(Arg<i32>); let mut builder = Injector::builder(); builder.provide(Foo.transient()); builder.with_arg::<Foo, i32>(12); let injector = builder.build(); let foo: Box<Foo> = injector.get().unwrap(); assert_eq!(12, *foo.0);
Implementations
impl<T> Arg<T> where
T: Service + AsAny + Clone,
[src]
impl<T> Arg<T> where
T: Service + AsAny + Clone,
[src]pub fn into_inner(arg: Arg<T>) -> T
[src]
pub fn into_inner(arg: Arg<T>) -> T
[src]Converts an argument into its inner value.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Arg<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Arg<T>
impl<T> Sync for Arg<T>
impl<T> Unpin for Arg<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Arg<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Interface for T where
T: Service,
[src]
impl<T> Interface for T where
T: Service,
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> InterfaceFor<T> for T where
T: Service,
[src]
T: Service,
impl<T> Service for T where
T: Any + Send + Sync + ?Sized,
[src]
T: Any + Send + Sync + ?Sized,