OptionsConfigurationServiceExtensions

Trait OptionsConfigurationServiceExtensions 

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

Defines extension methods for the ServiceCollection struct.

Required Methods§

Source

fn apply_config<T>( &mut self, configuration: Ref<dyn Configuration>, ) -> OptionsBuilder<'_, T>
where T: Value + Default + DeserializeOwned + 'static,

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

§Arguments
Source

fn apply_config_at<T>( &mut self, configuration: Ref<dyn Configuration>, key: impl AsRef<str>, ) -> OptionsBuilder<'_, T>
where T: Value + Default + DeserializeOwned + '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 OptionsConfigurationServiceExtensions for ServiceCollection

Source§

fn apply_config<T>( &mut self, configuration: Ref<dyn Configuration>, ) -> OptionsBuilder<'_, T>
where T: Value + Default + DeserializeOwned + 'static,

Source§

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

Implementors§