Trait starship::config::ModuleConfig

source ·
pub trait ModuleConfig<'a, E>
where Self: Default, E: SerdeError,
{ // Required method fn from_config<V: Into<ValueRef<'a>>>(config: V) -> Result<Self, E>; // Provided methods fn load<V: Into<ValueRef<'a>>>(config: V) -> Self { ... } fn try_load<V: Into<ValueRef<'a>>>(config: Option<V>) -> Self { ... } }
Expand description

Root config of a module.

Required Methods§

source

fn from_config<V: Into<ValueRef<'a>>>(config: V) -> Result<Self, E>

Construct a ModuleConfig from a toml value.

Provided Methods§

source

fn load<V: Into<ValueRef<'a>>>(config: V) -> Self

Loads the TOML value into the config. Missing values are set to their default values. On error, logs an error message.

source

fn try_load<V: Into<ValueRef<'a>>>(config: Option<V>) -> Self

Helper function that will call ModuleConfig::from_config(config) if config is Some, or ModuleConfig::default()` if config is None.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, T: Deserialize<'a> + Default> ModuleConfig<'a, Error> for T