pub struct OptionsCascade<'a> { /* private fields */ }
Expand description
A cascade of option sets.
Options added later in the cascade override earlier options.
Implementations§
Source§impl<'a> OptionsCascade<'a>
impl<'a> OptionsCascade<'a>
Sourcepub fn new_typical(
model_default: &'a Options,
env_defaults: &'a Options,
model_config: &'a Options,
specific_config: Option<&'a Options>,
) -> Self
pub fn new_typical( model_default: &'a Options, env_defaults: &'a Options, model_config: &'a Options, specific_config: Option<&'a Options>, ) -> Self
Setups a typical options cascade, with model_defaults, environment defaults a model config and possibly a specific config.
Sourcepub fn from_vec(cascades: Vec<&'a Options>) -> Self
pub fn from_vec(cascades: Vec<&'a Options>) -> Self
Creates a new cascade of options from a vector of option sets.
Sourcepub fn with_options(self, options: &'a Options) -> Self
pub fn with_options(self, options: &'a Options) -> Self
Returns a new cascade of options with the given set of options added.
Sourcepub fn get(&self, opt_discriminant: OptDiscriminants) -> Option<&Opt>
pub fn get(&self, opt_discriminant: OptDiscriminants) -> Option<&Opt>
Gets the value of an option from this cascade.
Returns None
if the option is not present in any set in this cascade.
If the option is present in multiple sets, the value from the most
recently added set is returned.
Sourcepub fn is_streaming(&self) -> bool
pub fn is_streaming(&self) -> bool
Returns a boolean indicating if options indicate that requests should be streamed or not.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for OptionsCascade<'a>
impl<'a> RefUnwindSafe for OptionsCascade<'a>
impl<'a> Send for OptionsCascade<'a>
impl<'a> Sync for OptionsCascade<'a>
impl<'a> Unpin for OptionsCascade<'a>
impl<'a> UnwindSafe for OptionsCascade<'a>
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