pub struct Config<T> { /* private fields */ }Expand description
Wrapper around a validated configuration value.
This type ensures that the configuration has been loaded and validated.
It implements Deref to provide transparent access to the inner type.
Implementations§
Source§impl<T> Config<T>
impl<T> Config<T>
Sourcepub fn new(value: T) -> Self
pub fn new(value: T) -> Self
Create a new Config wrapping an already-validated value.
This is primarily used internally after successful validation.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume this Config and return the inner value.
Sourcepub fn builder() -> ConfigBuilder<T>
pub fn builder() -> ConfigBuilder<T>
Create a builder for this configuration type.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Config<T>where
T: Freeze,
impl<T> RefUnwindSafe for Config<T>where
T: RefUnwindSafe,
impl<T> Send for Config<T>where
T: Send,
impl<T> Sync for Config<T>where
T: Sync,
impl<T> Unpin for Config<T>where
T: Unpin,
impl<T> UnsafeUnpin for Config<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Config<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more