Skip to main content

Host

Trait Host 

Source
pub trait Host: 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".

Implementations on Foreign Types§

Source§

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

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>

Implementors§