envstruct::prelude

Trait EnvParseNested

Source
pub trait EnvParseNested {
    // Required methods
    fn parse_from_env_var(
        var_name: impl AsRef<str>,
        default: Option<&str>,
    ) -> Result<Self, EnvStructError>
       where Self: Sized;
    fn get_env_entries(
        prefix: impl AsRef<str>,
        default: Option<&str>,
    ) -> Result<Vec<EnvEntry>, EnvStructError>;

    // Provided methods
    fn new() -> Result<Self, EnvStructError>
       where Self: Sized { ... }
    fn with_prefix(prefix: impl AsRef<str>) -> Result<Self, EnvStructError>
       where Self: Sized { ... }
}

Required Methods§

Source

fn parse_from_env_var( var_name: impl AsRef<str>, default: Option<&str>, ) -> Result<Self, EnvStructError>
where Self: Sized,

Source

fn get_env_entries( prefix: impl AsRef<str>, default: Option<&str>, ) -> Result<Vec<EnvEntry>, EnvStructError>

Provided Methods§

Source

fn new() -> Result<Self, EnvStructError>
where Self: Sized,

Source

fn with_prefix(prefix: impl AsRef<str>) -> Result<Self, EnvStructError>
where Self: Sized,

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: EnvParseNested> EnvParseNested for Option<T>

Source§

fn parse_from_env_var( var_name: impl AsRef<str>, default: Option<&str>, ) -> Result<Self, EnvStructError>
where Self: Sized,

Source§

fn get_env_entries( prefix: impl AsRef<str>, default: Option<&str>, ) -> Result<Vec<EnvEntry>, EnvStructError>

Source§

impl<T: EnvParseNested> EnvParseNested for Rc<T>

Source§

fn parse_from_env_var( var_name: impl AsRef<str>, default: Option<&str>, ) -> Result<Self, EnvStructError>

Source§

fn get_env_entries( prefix: impl AsRef<str>, default: Option<&str>, ) -> Result<Vec<EnvEntry>, EnvStructError>

Source§

impl<T: EnvParseNested> EnvParseNested for Arc<T>

Source§

fn parse_from_env_var( var_name: impl AsRef<str>, default: Option<&str>, ) -> Result<Self, EnvStructError>

Source§

fn get_env_entries( prefix: impl AsRef<str>, default: Option<&str>, ) -> Result<Vec<EnvEntry>, EnvStructError>

Source§

impl<T: EnvParseNested> EnvParseNested for Cell<T>

Source§

fn parse_from_env_var( var_name: impl AsRef<str>, default: Option<&str>, ) -> Result<Self, EnvStructError>

Source§

fn get_env_entries( prefix: impl AsRef<str>, default: Option<&str>, ) -> Result<Vec<EnvEntry>, EnvStructError>

Source§

impl<T: EnvParseNested> EnvParseNested for RefCell<T>

Source§

fn parse_from_env_var( var_name: impl AsRef<str>, default: Option<&str>, ) -> Result<Self, EnvStructError>

Source§

fn get_env_entries( prefix: impl AsRef<str>, default: Option<&str>, ) -> Result<Vec<EnvEntry>, EnvStructError>

Implementors§

Source§

impl<K, V> EnvParseNested for EnvMap<K, V>
where K: FromStr + Hash + Eq, V: EnvParsePrimitive,