Skip to main content

Config

Struct Config 

Source
pub struct Config { /* private fields */ }

Implementations§

Source§

impl Config

Source

pub fn bool(&self, key: &str) -> Option<bool>

Source

pub fn require_bool(&self, key: &str) -> bool

Source

pub fn bool_or(&self, key: &str, default: bool) -> bool

Source§

impl Config

Source

pub fn date(&self, key: &str) -> Option<Date>

Source

pub fn require_date(&self, key: &str) -> Date

Source

pub fn date_or(&self, key: &str, default: Date) -> Date

Source§

impl Config

Source

pub fn datetime(&self, key: &str) -> Option<DateTime>

Source

pub fn require_datetime(&self, key: &str) -> DateTime

Source

pub fn datetime_or(&self, key: &str, default: DateTime) -> DateTime

Source§

impl Config

Source

pub fn decimal(&self, key: &str) -> Option<Decimal>

Source

pub fn require_decimal(&self, key: &str) -> Decimal

Source

pub fn decimal_or(&self, key: &str, default: Decimal) -> Decimal

Source§

impl Config

Source§

impl Config

Source

pub fn duration(&self, key: &str) -> Option<Duration>

Source

pub fn require_duration(&self, key: &str) -> Duration

Source

pub fn duration_or(&self, key: &str, default: Duration) -> Duration

Source§

impl Config

Source

pub fn f32(&self, key: &str) -> Option<f32>

Source

pub fn require_f32(&self, key: &str) -> f32

Source

pub fn f32_or(&self, key: &str, default: f32) -> f32

Source§

impl Config

Source

pub fn f64(&self, key: &str) -> Option<f64>

Source

pub fn require_f64(&self, key: &str) -> f64

Source

pub fn f64_or(&self, key: &str, default: f64) -> f64

Source§

impl Config

Source

pub fn i128(&self, key: &str) -> Option<i128>

Source

pub fn require_i128(&self, key: &str) -> i128

Source

pub fn i128_or(&self, key: &str, default: i128) -> i128

Source§

impl Config

Source

pub fn i16(&self, key: &str) -> Option<i16>

Source

pub fn require_i16(&self, key: &str) -> i16

Source

pub fn i16_or(&self, key: &str, default: i16) -> i16

Source§

impl Config

Source

pub fn i32(&self, key: &str) -> Option<i32>

Source

pub fn require_i32(&self, key: &str) -> i32

Source

pub fn i32_or(&self, key: &str, default: i32) -> i32

Source§

impl Config

Source

pub fn i64(&self, key: &str) -> Option<i64>

Source

pub fn require_i64(&self, key: &str) -> i64

Source

pub fn i64_or(&self, key: &str, default: i64) -> i64

Source§

impl Config

Source

pub fn i8(&self, key: &str) -> Option<i8>

Source

pub fn require_i8(&self, key: &str) -> i8

Source

pub fn i8_or(&self, key: &str, default: i8) -> i8

Source§

impl Config

Source

pub fn identity_id(&self, key: &str) -> Option<IdentityId>

Source

pub fn require_identity_id(&self, key: &str) -> IdentityId

Source

pub fn identity_id_or(&self, key: &str, default: IdentityId) -> IdentityId

Source§

impl Config

Source

pub fn int(&self, key: &str) -> Option<Int>

Source

pub fn require_int(&self, key: &str) -> Int

Source

pub fn int_or(&self, key: &str, default: Int) -> Int

Source§

impl Config

Source

pub fn str(&self, key: &str) -> Option<String>

Source

pub fn require_str(&self, key: &str) -> String

Source

pub fn str_or(&self, key: &str, default: &str) -> String

Source§

impl Config

Source

pub fn time(&self, key: &str) -> Option<Time>

Source

pub fn require_time(&self, key: &str) -> Time

Source

pub fn time_or(&self, key: &str, default: Time) -> Time

Source§

impl Config

Source

pub fn u128(&self, key: &str) -> Option<u128>

Source

pub fn require_u128(&self, key: &str) -> u128

Source

pub fn u128_or(&self, key: &str, default: u128) -> u128

Source§

impl Config

Source

pub fn u16(&self, key: &str) -> Option<u16>

Source

pub fn require_u16(&self, key: &str) -> u16

Source

pub fn u16_or(&self, key: &str, default: u16) -> u16

Source§

impl Config

Source

pub fn u32(&self, key: &str) -> Option<u32>

Source

pub fn require_u32(&self, key: &str) -> u32

Source

pub fn u32_or(&self, key: &str, default: u32) -> u32

Source§

impl Config

Source

pub fn u64(&self, key: &str) -> Option<u64>

Source

pub fn require_u64(&self, key: &str) -> u64

Source

pub fn u64_or(&self, key: &str, default: u64) -> u64

Source§

impl Config

Source

pub fn u8(&self, key: &str) -> Option<u8>

Source

pub fn require_u8(&self, key: &str) -> u8

Source

pub fn u8_or(&self, key: &str, default: u8) -> u8

Source§

impl Config

Source

pub fn uint(&self, key: &str) -> Option<Uint>

Source

pub fn require_uint(&self, key: &str) -> Uint

Source

pub fn uint_or(&self, key: &str, default: Uint) -> Uint

Source§

impl Config

Source

pub fn usize(&self, key: &str) -> Option<usize>

Source

pub fn require_usize(&self, key: &str) -> usize

Source

pub fn usize_or(&self, key: &str, default: usize) -> usize

Source§

impl Config

Source§

impl Config

Source

pub fn new(name: impl Into<String>, values: BTreeMap<String, Value>) -> Self

Source

pub fn name(&self) -> &str

Source

pub fn get(&self, key: &str) -> Option<&Value>

Source

pub fn contains(&self, key: &str) -> bool

Source

pub fn iter(&self) -> impl Iterator<Item = (&String, &Value)>

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.