pub struct WelcomeState {Show 16 fields
pub step: usize,
pub providers: Vec<ProviderStatus>,
pub provider_selected: usize,
pub key_input: String,
pub key_editing: bool,
pub key_error: Option<String>,
pub models: Vec<ModelMeta>,
pub model_selected: usize,
pub thinking_level: ThinkingLevel,
pub auth_resolved: bool,
pub resolved_key: Option<String>,
pub web_providers: Vec<WebProviderStatus>,
pub web_provider_selected: usize,
pub web_key_input: String,
pub resolved_web_provider: Option<String>,
pub resolved_web_key: Option<String>,
}Expand description
State for the welcome overlay.
Fields§
§step: usize§providers: Vec<ProviderStatus>Provider list with detection status.
provider_selected: usizeCurrently selected provider index.
key_input: StringAPI key input buffer (masked display).
key_editing: boolWhether the key input field is active.
key_error: Option<String>Error message for invalid key input.
models: Vec<ModelMeta>Available models for the selected provider.
model_selected: usizeSelected model index.
thinking_level: ThinkingLevelSelected thinking level.
auth_resolved: boolWhether auth was resolved (env or input).
resolved_key: Option<String>The resolved API key (if entered manually).
web_providers: Vec<WebProviderStatus>Optional web search providers for the built-in web tool.
web_provider_selected: usizeSelected web provider index.
web_key_input: StringOptional web provider key input.
resolved_web_provider: Option<String>Resolved web provider id.
resolved_web_key: Option<String>Resolved web provider key (if entered manually).
Implementations§
Source§impl WelcomeState
impl WelcomeState
Sourcepub fn new(all_models: &[ModelMeta]) -> Self
pub fn new(all_models: &[ModelMeta]) -> Self
Create welcome state, detecting existing auth from env vars for all registered providers.
Sourcepub fn mark_stored(&mut self, provider_id: &str)
pub fn mark_stored(&mut self, provider_id: &str)
Mark a provider as having a stored credential.
pub fn current_step(&self) -> WelcomeStep
pub fn selected_provider(&self) -> Option<&ProviderStatus>
Sourcepub fn selected_provider_id(&self) -> Option<&str>
pub fn selected_provider_id(&self) -> Option<&str>
Return the selected provider’s id string.
pub fn selected_model(&self) -> Option<&ModelMeta>
pub fn advance(&mut self)
pub fn go_back(&mut self)
pub fn provider_up(&mut self)
pub fn provider_down(&mut self)
pub fn model_up(&mut self)
pub fn model_down(&mut self)
pub fn cycle_thinking(&mut self)
pub fn cycle_thinking_back(&mut self)
pub fn push_key_char(&mut self, c: char)
pub fn pop_key_char(&mut self)
Sourcepub fn check_auth_resolved(&mut self) -> Result<(), String>
pub fn check_auth_resolved(&mut self) -> Result<(), String>
Check whether auth is available for the current provider (env or entered key).
pub fn update_models(&mut self, all_models: &[ModelMeta])
pub fn selected_web_provider(&self) -> Option<&WebProviderStatus>
pub fn web_provider_up(&mut self)
pub fn web_provider_down(&mut self)
pub fn push_web_key_char(&mut self, c: char)
pub fn pop_web_key_char(&mut self)
pub fn check_web_auth_resolved(&mut self) -> Result<(), String>
Trait Implementations§
Source§impl Clone for WelcomeState
impl Clone for WelcomeState
Source§fn clone(&self) -> WelcomeState
fn clone(&self) -> WelcomeState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WelcomeState
impl RefUnwindSafe for WelcomeState
impl Send for WelcomeState
impl Sync for WelcomeState
impl Unpin for WelcomeState
impl UnsafeUnpin for WelcomeState
impl UnwindSafe for WelcomeState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more