pub struct QuestionSource {
pub question: Option<String>,
pub preset: Option<String>,
}Expand description
Source of the rubric question: either an explicit --question string
or a named --preset. At least one of the two must be provided.
Fields§
§question: Option<String>Explicit rubric question (required if –preset is not set).
preset: Option<String>Named question preset (required if –question is not set).
Implementations§
Source§impl QuestionSource
impl QuestionSource
Sourcepub fn from_question(question: String) -> Self
pub fn from_question(question: String) -> Self
Build a source from an already-known question string (no preset).
Sourcepub fn resolve(&self) -> Result<String, PresetError>
pub fn resolve(&self) -> Result<String, PresetError>
Resolves the effective question text.
When --preset was provided, delegates to crate::presets::resolve.
When --question was provided, returns it verbatim.
Sourcepub fn resolve_system_prompt(&self) -> Result<Option<String>, PresetError>
pub fn resolve_system_prompt(&self) -> Result<Option<String>, PresetError>
Resolves the preset’s standard system prompt.
Returns None when no preset was selected or the preset does not
define a system prompt. Callers should prefer an explicit
--system-prompt over this value.
Trait Implementations§
Source§impl Args for QuestionSource
impl Args for QuestionSource
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for QuestionSource
impl Clone for QuestionSource
Source§fn clone(&self) -> QuestionSource
fn clone(&self) -> QuestionSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuestionSource
impl Debug for QuestionSource
Source§impl FromArgMatches for QuestionSource
impl FromArgMatches for QuestionSource
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Auto Trait Implementations§
impl Freeze for QuestionSource
impl RefUnwindSafe for QuestionSource
impl Send for QuestionSource
impl Sync for QuestionSource
impl Unpin for QuestionSource
impl UnsafeUnpin for QuestionSource
impl UnwindSafe for QuestionSource
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