Trait Host

Source
pub trait Host: Send + Send {
    // Required methods
    fn get(
        &mut self,
        key: String,
    ) -> impl Future<Output = Result<Option<String>, Error>> + Send;
    fn get_all(
        &mut self,
    ) -> impl Future<Output = Result<Vec<(String, String)>, Error>> + Send;
    fn convert_error(&mut self, err: Error) -> Result<Error>;
}

Required Methods§

Source

fn get( &mut self, key: String, ) -> impl Future<Output = Result<Option<String>, Error>> + Send

Gets a configuration value of type string associated with the key.

The value is returned as an option<string>. If the key is not found, Ok(none) is returned. If an error occurs, an Err(error) is returned.

Source

fn get_all( &mut self, ) -> impl Future<Output = Result<Vec<(String, String)>, Error>> + Send

Gets a list of configuration key-value pairs of type string.

If an error occurs, an Err(error) is returned.

Source

fn convert_error(&mut self, err: Error) -> Result<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.

Implementations on Foreign Types§

Source§

impl<_T: Host + ?Sized + Send> Host for &mut _T

Source§

async fn get(&mut self, key: String) -> Result<Option<String>, Error>

Gets a configuration value of type string associated with the key.

The value is returned as an option<string>. If the key is not found, Ok(none) is returned. If an error occurs, an Err(error) is returned.

Source§

async fn get_all(&mut self) -> Result<Vec<(String, String)>, Error>

Gets a list of configuration key-value pairs of type string.

If an error occurs, an Err(error) is returned.

Source§

fn convert_error(&mut self, err: Error) -> Result<Error>

Implementors§