Trait composable::dependencies::DependencyDefault

source ·
pub trait DependencyDefault: Default { }
Expand description

The default value for a dependency.

There may be many different versions of dependencies for testing but there is often just a single default implementation for use in the the actual application.

Implementing this trait for a type ensures that a Dependency on it will always have a value. If the DependencyDefault value has not been overridden it will be returned.

Attempting to use this default behavior in a unit test will fail the test, as tests are required to explicitly supply all of their dependencies.

§Note

DependencyDefaults are only created as needed. When its first Dependency is created, default will be called once and the returned value will be cached.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: DependencyDefault> DependencyDefault for Cell<T>

Implementors§

source§

impl DependencyDefault for Scale

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Values

Available on crate features unstable and views only.
source§

impl DependencyDefault for Inter<'static, L>

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Inter<'static, M>

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Inter<'static, S>

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Inter<'static, L>

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Inter<'static, M>

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Inter<'static, S>

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Inter<'static, L>

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Inter<'static, M>

Available on crate features unstable and views and default_ui only.
source§

impl DependencyDefault for Inter<'static, S>

Available on crate features unstable and views and default_ui only.