pub struct Wizard {
pub meta: Meta,
pub steps: Vec<Step>,
pub summary: bool,
pub finish: Finish,
pub cancel: Option<Confirmation>,
}Expand description
A wizard: its steps, its summary, what finishing runs, and what cancelling asks when something was entered.
Fields§
§meta: Meta§steps: Vec<Step>§summary: boolA summary step after the last one.
finish: Finish§cancel: Option<Confirmation>What cancelling asks once something was entered (the shell’s own words otherwise).
Implementations§
Source§impl Wizard
impl Wizard
pub fn description(self, text: &str) -> Wizard
pub fn icon(self, icon: &str) -> Wizard
Sourcepub fn step(
self,
id: &str,
title: &str,
build: impl FnOnce(&mut SectionBuilder<'_>),
) -> Wizard
pub fn step( self, id: &str, title: &str, build: impl FnOnce(&mut SectionBuilder<'_>), ) -> Wizard
A step, built as a section is (groups, fields, statuses…): its
draft fields are Field::drafts of this wizard.
Sourcepub fn args(self, args: Json) -> Wizard
pub fn args(self, args: Json) -> Wizard
The finish’s arguments: a template over the draft (${key}).
Sourcepub fn no_summary(self) -> Wizard
pub fn no_summary(self) -> Wizard
No summary: the last step finishes.
Sourcepub fn cancel(self, confirmation: Confirmation) -> Wizard
pub fn cancel(self, confirmation: Confirmation) -> Wizard
What cancelling asks once something was entered.
pub fn step_of(&self, id: &str) -> Option<&Step>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Wizard
impl<'de> Deserialize<'de> for Wizard
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Wizard
Auto Trait Implementations§
impl Freeze for Wizard
impl RefUnwindSafe for Wizard
impl Send for Wizard
impl Sync for Wizard
impl Unpin for Wizard
impl UnsafeUnpin for Wizard
impl UnwindSafe for Wizard
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