pub struct Options { /* private fields */ }Expand description
A collection of options that can be used to configure a model.
Options is the struct that represents a set of options for a large language model.
It provides methods for creating, adding, and retrieving options.
The ‘Options’ struct is mainly created using the OptionsBuilder to allow for
flexibility in setting options.
Implementations§
source§impl Options
impl Options
sourcepub fn builder() -> OptionsBuilder
pub fn builder() -> OptionsBuilder
sourcepub fn empty() -> &'static Self
pub fn empty() -> &'static Self
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 set of options.
This function finds the first option in opts that matches the provided OptDiscriminants.
Arguments
opt_discriminant- AnOptDiscriminantsvalue representing the discriminant of the desiredOpt.
Returns
An Option that contains a reference to the Opt if found, or None if not found.
Example
let mut builder = Options::builder();
builder.add_option(Opt::Model(ModelRef::from_path("path_to_model")));
let options = builder.build();
let model_option = options.get(OptDiscriminants::Model);Trait Implementations§
source§impl<'de> Deserialize<'de> for Options
impl<'de> Deserialize<'de> for Options
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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