[][src]Enum env_parser::EnvType

pub enum EnvType {
    I32(i32),
    I64(i64),
    I128(i128),
    U128(u128),
    F32(f32),
    F64(f64),
    USize(usize),
    StaticStr(String),
    Custom(Box<dyn CustomMap>),
}

The different values an env file can hold

Variants

I32(i32)
I64(i64)
I128(i128)
U128(u128)
F32(f32)
F64(f64)
USize(usize)
StaticStr(String)
Custom(Box<dyn CustomMap>)

Implementations

impl EnvType[src]

pub fn rust_type(&self) -> String[src]

The Rust type

pub fn raw_value(&self) -> String[src]

The actual value the env property holds

pub fn value(&self) -> String[src]

Adds the type if needed behind the raw value This is needed if the user wants the value 1 to be an f32. If you only type:

This example deliberately fails to compile
const MY_VARIABLE: f32 = 1;

The following compile error occurs: mismatched types [E0308] expected f32, found i32 Thats why the type is needed behind the value:

const MY_VARIABLE: f32 = 1f32;

Auto Trait Implementations

impl !RefUnwindSafe for EnvType

impl !Send for EnvType

impl !Sync for EnvType

impl Unpin for EnvType

impl !UnwindSafe for EnvType

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.