Skip to main content

ProvideMutWith

Trait ProvideMutWith 

Source
pub trait ProvideMutWith<'me, T, C> {
    // Required method
    fn provide_mut_with(&'me mut self, context: C) -> T;
}
Expand description

Type of provider which provides dependency by unique reference, but with additional context provided by the caller.

This trait is very similar to ProvideMut trait. However, this trait allows to retrieve additional context provided by the caller, so it is possible to define many ways of how dependency can be provided.

See crate documentation for more.

Required Methods§

Source

fn provide_mut_with(&'me mut self, context: C) -> T

Provides dependency by unique reference with additional context provided by the caller.

§Examples
use provide::with::ProvideMutWith;

todo!()

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'me, T, U> ProvideMutWith<'me, T, ()> for U
where U: ProvideMut<'me, T> + ?Sized,