Skip to main content

ConfigExt

Trait ConfigExt 

Source
pub trait ConfigExt<C>: Sized {
    // Required methods
    fn apply_config<T>(&mut self, configuration: C) -> Builder<'_, T>
       where T: Value + Default + DeserializeOwned + Send + Sync + 'static;
    fn apply_config_at<T>(
        &mut self,
        configuration: C,
        key: impl AsRef<str>,
    ) -> Builder<'_, T>
       where T: Value + Default + DeserializeOwned + Send + Sync + 'static;
}
Available on crate feature cfg only.
Expand description

Defines configuration extension methods for a ServiceCollection.

Required Methods§

Source

fn apply_config<T>(&mut self, configuration: C) -> Builder<'_, T>
where T: Value + Default + DeserializeOwned + Send + Sync + 'static,

Registers an options type that will have all of its associated services registered.

§Arguments
Source

fn apply_config_at<T>( &mut self, configuration: C, key: impl AsRef<str>, ) -> Builder<'_, T>
where T: Value + Default + DeserializeOwned + Send + Sync + 'static,

Registers an options type that will have all of its associated services registered.

§Arguments

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<C> ConfigExt<C> for ServiceCollection
where C: Value + Binder + Reloadable + Clone + 'static,

Available on crate features di or cfg only.
Source§

fn apply_config<T>(&mut self, configuration: C) -> Builder<'_, T>
where T: Value + Default + DeserializeOwned + 'static,

Source§

fn apply_config_at<T>( &mut self, configuration: C, key: impl AsRef<str>, ) -> Builder<'_, T>
where T: Value + Default + DeserializeOwned + 'static,

Implementors§