pub struct StepperController { /* private fields */ }Expand description
Shared handle controlling a Stepper.
Implementations§
Source§impl StepperController
impl StepperController
Sourcepub fn new(step_count: usize) -> Self
pub fn new(step_count: usize) -> Self
A controller for a stepper with step_count steps, starting at step 0.
Sourcepub fn next(&self)
pub fn next(&self)
Advance to the next reachable step, recording the current one on
the back-stack. Invisible (Step::visible_when)
and StepStatus::Disabled steps are stepped over; a no-op when none
remains.
Sourcepub fn back(&self)
pub fn back(&self)
Return to the most recently visited reachable step (the back-stack top). Entries that became unreachable meanwhile are popped and skipped. No-op on an empty stack.
Sourcepub fn reset(&self)
pub fn reset(&self)
Reset to the first reachable step: clears the back-stack, restores the
statuses the stepper was declared with (so a Disabled / Optional
step keeps its character), and clears visited/skipped flags. Per-step
visibility is app-owned and left untouched.
Sourcepub fn set_status(&self, idx: usize, status: StepStatus)
pub fn set_status(&self, idx: usize, status: StepStatus)
Override a step’s StepStatus (e.g. mark it Error after async
validation). Setting StepStatus::Disabled takes the step out of the
flow — next / go_to skip it — but does
not move off it if it is the active step.
Sourcepub fn set_visible(&self, idx: usize, visible: bool)
pub fn set_visible(&self, idx: usize, visible: bool)
Show or hide step idx. A hidden step is skipped by
next / back / go_to
and drops out of the indicator strip — the branching-wizard shape
(“this step only if you chose X”) without maintaining two step lists.
Usually driven declaratively by
Step::visible_when; this is the
imperative twin. Hiding the active step does not navigate away from
it — hide steps the user has not reached yet.
pub fn current(&self) -> usize
pub fn status(&self, idx: usize) -> StepStatus
Sourcepub fn is_visible(&self, idx: usize) -> bool
pub fn is_visible(&self, idx: usize) -> bool
true if step idx is visible (see set_visible).
Sourcepub fn is_reachable(&self, idx: usize) -> bool
pub fn is_reachable(&self, idx: usize) -> bool
true if step idx participates in the flow — visible and not
StepStatus::Disabled.
Sourcepub fn next_reachable(&self, from: usize) -> Option<usize>
pub fn next_reachable(&self, from: usize) -> Option<usize>
The next reachable step after from, if any.
Sourcepub fn has_next(&self) -> bool
pub fn has_next(&self) -> bool
true if next would move — i.e. the active step is not
the last reachable one. The footer shows Next when this holds and
Finish when it does not.
pub fn step_count(&self) -> usize
Sourcepub fn can_back(&self) -> bool
pub fn can_back(&self) -> bool
true if there is a previously-visited, still-reachable step to
return to.
Sourcepub fn current_step_signal(&self) -> Signal<usize>
pub fn current_step_signal(&self) -> Signal<usize>
The active-step signal — the stepper’s Switcher and indicators bind
to it.
Sourcepub fn version_signal(&self) -> Signal<u64>
pub fn version_signal(&self) -> Signal<u64>
Bumped on every structural mutation; bind at BindingLevel::Rebuild.
Trait Implementations§
Source§impl Clone for StepperController
impl Clone for StepperController
Source§fn clone(&self) -> StepperController
fn clone(&self) -> StepperController
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 !RefUnwindSafe for StepperController
impl !Send for StepperController
impl !Sync for StepperController
impl !UnwindSafe for StepperController
impl Freeze for StepperController
impl Unpin for StepperController
impl UnsafeUnpin for StepperController
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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