Trait Options

Source
pub trait Options {
    // Required methods
    fn bind_config<C: Configuration>(&mut self, config: &C) -> Result<()>;
    fn validate(&self) -> Result<()>;

    // Provided method
    fn bind<C: Configuration>(&mut self, config: &C) -> Result<()> { ... }
}
Expand description

A type which can be bound by configuration.

Required Methods§

Source

fn bind_config<C: Configuration>(&mut self, config: &C) -> Result<()>

Bind values from configuration - normally not called directly.

Source

fn validate(&self) -> Result<()>

Validate current instance after binding.

Provided Methods§

Source

fn bind<C: Configuration>(&mut self, config: &C) -> Result<()>

Bind and validate configuration.

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 Options for String

Source§

fn bind_config<C: Configuration>(&mut self, config: &C) -> Result<()>

Source§

fn validate(&self) -> Result<()>

Implementors§