Trait AsyncTryFromEnv

Source
pub trait AsyncTryFromEnv {
    type Error;

    // Required method
    fn new_from_env<'life0, 'async_trait>(
        var_name: &'life0 str,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for asynchronously creating Self specifically from an environment variable name.

Required Associated Types§

Required Methods§

Source

fn new_from_env<'life0, 'async_trait>( var_name: &'life0 str, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Creates an instance of Self by reading an environment variable asynchronously (if needed).

Implementors§