[][src]Trait germinate::ValueLoader

pub trait ValueLoader {
#[must_use]    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 String
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

A type implementing the ValueLoader trait can be used to load a value from a store by it's key

For example, the type could load a value from and environment variable, or an external key value store like etcd.

As the value could be loaded from an external network source, it must be done asynchronously to allow non-blocking value loading

Required methods

#[must_use]fn load<'life0, 'life1, 'async_trait>(
    &'life0 self,
    key: &'life1 String
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Loading content...

Implementors

impl ValueLoader for AwsSsmLoader[src]

fn load<'life0, 'life1, 'async_trait>(
    &'life0 self,
    key: &'life1 String
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Loads a value from the Parameter Store and returns it as a String

impl ValueLoader for EnvironmentLoader[src]

fn load<'life0, 'life1, 'async_trait>(
    &'life0 self,
    key: &'life1 String
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Load a value from the environment. The key is the name of the environment variable containing the value

Loading content...