UpdateFromConfig

Trait UpdateFromConfig 

Source
pub trait UpdateFromConfig {
    // Required method
    fn update_from_config(
        self,
        conf: &XvcConfiguration,
    ) -> Result<Box<Self>, Error>;
}
Expand description

A trait for updating an existing configuration struct with values from a complete XvcConfiguration.

This allows for merging configuration values into an already instantiated struct, often used for CLI options where some fields might already be set by the user.

Required Methods§

Source

fn update_from_config(self, conf: &XvcConfiguration) -> Result<Box<Self>, Error>

Updates the implementing struct with values from the provided XvcConfiguration.

The implementation is responsible for reading the relevant keys and values from conf and applying them to self.

§Arguments
  • self - The instance of the struct to be updated.
  • conf - A reference to the XvcConfiguration containing the values to apply.
§Returns

A Result containing a Boxed instance of the updated struct if successful, or an error.

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.

Implementors§