pub struct OptionBuilder<T: OptionType> { /* private fields */ }Expand description
Fluent constructor for Option<T>. See Option::builder.
Implementations§
Source§impl<T: OptionType> OptionBuilder<T>
impl<T: OptionType> OptionBuilder<T>
Sourcepub fn aliases(self, aliases: &'static [&'static str]) -> Self
pub fn aliases(self, aliases: &'static [&'static str]) -> Self
Extra names that resolve to this option (ts for tabstop).
Replaces any aliases set earlier. Each must be unique across the
registry, or registration fails with
crate::ConfigError::DuplicateName.
Sourcepub fn validate(self, f: ValidateFn<T>) -> Self
pub fn validate(self, f: ValidateFn<T>) -> Self
Install the post-parse validator run on every write (see
ValidateFn). Replaces any earlier one. The default passed to
Option::builder is NOT validated.
Sourcepub fn build(self) -> Option<T>
pub fn build(self) -> Option<T>
Finish: the Option<T> holding the default as its current
value, ready for crate::ConfigRegistry::register.
Auto Trait Implementations§
impl<T> Freeze for OptionBuilder<T>where
T: Freeze,
impl<T> RefUnwindSafe for OptionBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for OptionBuilder<T>
impl<T> Sync for OptionBuilder<T>
impl<T> Unpin for OptionBuilder<T>where
T: Unpin,
impl<T> UnsafeUnpin for OptionBuilder<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for OptionBuilder<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