pub struct ContextModel { /* private fields */ }Expand description
The strip’s model.
Implementations§
Source§impl ContextModel
impl ContextModel
Sourcepub fn new(providers: Vec<ProviderChoice>) -> Self
pub fn new(providers: Vec<ProviderChoice>) -> Self
Start on the first provider, so the strip is never half-set.
Sourcepub fn providers(&self) -> &[ProviderChoice]
pub fn providers(&self) -> &[ProviderChoice]
The providers.
Sourcepub fn provider(&self) -> Option<&ProviderChoice>
pub fn provider(&self) -> Option<&ProviderChoice>
The current provider.
Sourcepub fn model(&self) -> Option<&ModelChoice>
pub fn model(&self) -> Option<&ModelChoice>
The current model.
Sourcepub fn stored_effort(&self) -> Option<Effort>
pub fn stored_effort(&self) -> Option<Effort>
The effort the user set, even when the current model ignores it.
Sourcepub fn state(&self) -> ContextState
pub fn state(&self) -> ContextState
The resolved state.
Sourcepub fn set_provider(&mut self, provider: &str)
pub fn set_provider(&mut self, provider: &str)
Choose a provider and resolve the model against it: the model this provider had last time, else the one just chosen if it is offered here too, else its first.
Sourcepub fn set_effort(&mut self, effort: Effort)
pub fn set_effort(&mut self, effort: Effort)
Set the effort. Ignored for a model with no effort control.
Trait Implementations§
Source§impl Clone for ContextModel
impl Clone for ContextModel
Source§impl Debug for ContextModel
impl Debug for ContextModel
Source§impl Default for ContextModel
impl Default for ContextModel
impl Eq for ContextModel
Source§impl PartialEq for ContextModel
impl PartialEq for ContextModel
impl StructuralPartialEq for ContextModel
Auto Trait Implementations§
impl Freeze for ContextModel
impl RefUnwindSafe for ContextModel
impl Send for ContextModel
impl Sync for ContextModel
impl Unpin for ContextModel
impl UnsafeUnpin for ContextModel
impl UnwindSafe for ContextModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.