pub struct SettingsBuilder<AE: AsyncExecutor> { /* private fields */ }Expand description
Builder for creating Settings instances with custom overrides.
Implementations§
Source§impl<AE: AsyncExecutor> SettingsBuilder<AE>
impl<AE: AsyncExecutor> SettingsBuilder<AE>
Sourcepub fn without_env(self) -> Self
pub fn without_env(self) -> Self
Create a builder that ignores environment variables.
Sourcepub fn with_executor(self, executor: AE) -> Self
pub fn with_executor(self, executor: AE) -> Self
Set the async executor to use.
Sourcepub fn set<T: SettingType>(self, key: &Key<T>, value: T) -> Self
pub fn set<T: SettingType>(self, key: &Key<T>, value: T) -> Self
Set a typed value for a key.
Sourcepub fn build(self) -> Result<Settings<AE>, SettingsError>
pub fn build(self) -> Result<Settings<AE>, SettingsError>
Build the Settings instance, validating all invariants.
Trait Implementations§
Source§impl<AE: Default + AsyncExecutor> Default for SettingsBuilder<AE>
impl<AE: Default + AsyncExecutor> Default for SettingsBuilder<AE>
Source§fn default() -> SettingsBuilder<AE>
fn default() -> SettingsBuilder<AE>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<AE> Freeze for SettingsBuilder<AE>where
AE: Freeze,
impl<AE> RefUnwindSafe for SettingsBuilder<AE>where
AE: RefUnwindSafe,
impl<AE> Send for SettingsBuilder<AE>
impl<AE> Sync for SettingsBuilder<AE>
impl<AE> Unpin for SettingsBuilder<AE>where
AE: Unpin,
impl<AE> UnsafeUnpin for SettingsBuilder<AE>where
AE: UnsafeUnpin,
impl<AE> UnwindSafe for SettingsBuilder<AE>where
AE: 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