Skip to main content

SetupState

Struct SetupState 

Source
pub struct SetupState {
Show 35 fields pub step: SetupStep, pub should_quit: bool, pub outcome: Option<SetupOutcome>, pub check_results: Vec<CheckResult>, pub checks_loading: bool, pub checks_triggered: bool, pub config_path_display: Option<String>, pub config_was_created: bool, pub provider_choices: Vec<ProviderChoice>, pub provider_index: usize, pub auth_status: AuthStatus, pub username: Option<String>, pub auth_token: Option<String>, pub orgs: Vec<OrgEntry>, pub org_index: usize, pub org_loading: bool, pub org_discovery_in_progress: bool, pub org_error: Option<String>, pub base_path: String, pub path_cursor: usize, pub path_suggestions_mode: bool, pub path_suggestions: Vec<PathSuggestion>, pub path_suggestion_index: usize, pub path_completions: Vec<String>, pub path_completion_index: usize, pub path_browse_mode: bool, pub path_browse_current_dir: String, pub path_browse_entries: Vec<PathBrowseEntry>, pub path_browse_index: usize, pub path_browse_show_hidden: bool, pub path_browse_error: Option<String>, pub path_browse_info: Option<String>, pub error_message: Option<String>, pub tick_count: u64, pub is_first_setup: bool,
}
Expand description

The wizard state (model).

Fields§

§step: SetupStep

Current wizard step.

§should_quit: bool

Whether to quit the wizard.

§outcome: Option<SetupOutcome>

Outcome when done.

§check_results: Vec<CheckResult>§checks_loading: bool§checks_triggered: bool§config_path_display: Option<String>§config_was_created: bool§provider_choices: Vec<ProviderChoice>§provider_index: usize§auth_status: AuthStatus§username: Option<String>§auth_token: Option<String>§orgs: Vec<OrgEntry>§org_index: usize§org_loading: bool§org_discovery_in_progress: bool§org_error: Option<String>§base_path: String§path_cursor: usize§path_suggestions_mode: bool§path_suggestions: Vec<PathSuggestion>§path_suggestion_index: usize§path_completions: Vec<String>§path_completion_index: usize§path_browse_mode: bool§path_browse_current_dir: String§path_browse_entries: Vec<PathBrowseEntry>§path_browse_index: usize§path_browse_show_hidden: bool§path_browse_error: Option<String>§path_browse_info: Option<String>§error_message: Option<String>§tick_count: u64

Tick counter for spinner and animation effects.

§is_first_setup: bool

Whether this is the first workspace setup (controls UI text).

Implementations§

Source§

impl SetupState

Source

pub const TOTAL_STEPS: usize = 6

Total number of numbered steps (excluding Complete).

Source

pub fn new(default_base_path: &str) -> Self

Create initial wizard state.

Source

pub fn with_first_setup(default_base_path: &str, is_first_setup: bool) -> Self

Create wizard state, optionally marking as first-time setup.

Source

pub fn selected_provider(&self) -> ProviderKind

Get the selected provider kind.

Source

pub fn build_workspace_provider(&self) -> WorkspaceProvider

Build the WorkspaceProvider from current state.

Source

pub fn selected_orgs(&self) -> Vec<String>

Get selected org names.

Source

pub fn populate_path_suggestions(&mut self)

Populate the path suggestions list for the SelectPath step.

Source

pub fn requirements_passed(&self) -> bool

Whether all critical requirement checks have passed.

Source

pub fn step_number(&self) -> usize

The 1-based step number for display.

Source

pub fn next_step(&mut self)

Move to the next step.

Source

pub fn prev_step(&mut self)

Move to the previous step.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more