pub struct OptionSet { /* private fields */ }Expand description
A set of options.
It extracts the options by calling the OptionsMetadata::record of a type implementing
OptionsMetadata.
Implementations§
Source§impl OptionSet
impl OptionSet
pub fn of<T>() -> Selfwhere
T: OptionsMetadata + 'static,
Sourcepub fn record(&self, visit: &mut dyn Visit)
pub fn record(&self, visit: &mut dyn Visit)
Visits the options in this set by calling visit for each option.
pub fn documentation(&self) -> Option<&'static str>
Sourcepub fn has(&self, name: &str) -> bool
pub fn has(&self, name: &str) -> bool
Returns true if this set has an option that resolves to name.
The name can be separated by . to find a nested option.
Sourcepub fn find(&self, name: &str) -> Option<OptionEntry>
pub fn find(&self, name: &str) -> Option<OptionEntry>
Returns Some if this set has an option that resolves to name and None otherwise.
The name can be separated by . to find a nested option.
Trait Implementations§
impl Copy for OptionSet
impl Eq for OptionSet
Auto Trait Implementations§
impl Freeze for OptionSet
impl RefUnwindSafe for OptionSet
impl Send for OptionSet
impl Sync for OptionSet
impl Unpin for OptionSet
impl UnwindSafe for OptionSet
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