pub trait EnvVariable {
    type Type: ?Sized + ToOwned + Debug;

    // Required methods
    fn get_value(
        session: &Session,
        key: impl AsRef<str>
    ) -> Result<<Self::Type as ToOwned>::Owned>;
    fn set_value(
        session: &Session,
        key: impl AsRef<str>,
        val: &Self::Type
    ) -> Result<()>;
}
Expand description

Required Associated Types§

Required Methods§

source

fn get_value( session: &Session, key: impl AsRef<str> ) -> Result<<Self::Type as ToOwned>::Owned>

source

fn set_value( session: &Session, key: impl AsRef<str>, val: &Self::Type ) -> Result<()>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EnvVariable for i32

§

type Type = i32

source§

fn get_value(session: &Session, key: impl AsRef<str>) -> Result<Self::Type>

source§

fn set_value( session: &Session, key: impl AsRef<str>, val: &Self::Type ) -> Result<()>

source§

impl EnvVariable for str

§

type Type = str

source§

fn get_value(session: &Session, key: impl AsRef<str>) -> Result<String>

source§

fn set_value( session: &Session, key: impl AsRef<str>, val: &Self::Type ) -> Result<()>

source§

impl EnvVariable for Path

§

type Type = Path

source§

fn get_value(session: &Session, key: impl AsRef<str>) -> Result<PathBuf>

source§

fn set_value( session: &Session, key: impl AsRef<str>, val: &Self::Type ) -> Result<()>

Implementors§