Skip to main content

ConfigSource

Trait ConfigSource 

Source
pub trait ConfigSource {
    // Required methods
    fn source_name(&self) -> String;
    fn read_value(&mut self) -> Result<Option<Value>>;
    fn write_config<T>(&mut self, config: &T) -> Result<()>
       where T: Serialize;
}

Required Methods§

Source

fn source_name(&self) -> String

Source

fn read_value(&mut self) -> Result<Option<Value>>

Source

fn write_config<T>(&mut self, config: &T) -> Result<()>
where T: Serialize,

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 ConfigSource for &str

Source§

fn source_name(&self) -> String

Source§

fn read_value(&mut self) -> Result<Option<Value>>

Source§

fn write_config<T>(&mut self, config: &T) -> Result<()>
where T: Serialize,

Source§

impl<T> ConfigSource for &mut T
where T: ConfigSource + ?Sized,

Source§

fn source_name(&self) -> String

Source§

fn read_value(&mut self) -> Result<Option<Value>>

Source§

fn write_config<S>(&mut self, config: &S) -> Result<()>
where S: Serialize,

Implementors§