pub struct Flow {
pub wizard: String,
pub at: String,
pub values: BTreeMap<String, Value>,
pub initial: BTreeMap<String, Value>,
pub passed: Vec<String>,
}Expand description
A wizard being filled: the step shown, the draft, the steps passed.
Fields§
§wizard: String§at: StringA step’s id, or SUMMARY.
values: BTreeMap<String, Value>§initial: BTreeMap<String, Value>The draft at the start: what Cancel compares with.
passed: Vec<String>The steps left by Next or Skip (the stepper marks them done).
Implementations§
Source§impl Flow
impl Flow
Sourcepub fn start(
w: &Wizard,
base: &WhenContext,
values: BTreeMap<String, Value>,
) -> Flow
pub fn start( w: &Wizard, base: &WhenContext, values: BTreeMap<String, Value>, ) -> Flow
A flow at its first step, its draft the defaults with values
over them.
Sourcepub fn context(&self, base: &WhenContext) -> WhenContext
pub fn context(&self, base: &WhenContext) -> WhenContext
The context its clauses read: the application’s, and the draft as
form.<key>.
Sourcepub fn shown<'a>(&self, w: &'a Wizard, base: &WhenContext) -> Vec<&'a Step>
pub fn shown<'a>(&self, w: &'a Wizard, base: &WhenContext) -> Vec<&'a Step>
The steps that exist for the draft as it stands.
Sourcepub fn index(&self, w: &Wizard, base: &WhenContext) -> usize
pub fn index(&self, w: &Wizard, base: &WhenContext) -> usize
Where it stands among the steps shown (the summary after them).
pub fn on_summary(&self) -> bool
Sourcepub fn set(&mut self, w: &Wizard, key: &str, value: Value) -> Result<(), String>
pub fn set(&mut self, w: &Wizard, key: &str, value: Value) -> Result<(), String>
Sets a draft value; refused for a key no field of the wizard has.
Sourcepub fn problems(&self, step: &Step, j: &Judge<'_>) -> Vec<Problem>
pub fn problems(&self, step: &Step, j: &Judge<'_>) -> Vec<Problem>
A step’s problems for the draft as it stands: its fields’ own checks and hooks, then the step’s hook.
Sourcepub fn blocked(&self, step: &Step, j: &Judge<'_>) -> Option<Problem>
pub fn blocked(&self, step: &Step, j: &Judge<'_>) -> Option<Problem>
The first problem that blocks a step (danger), if any.
Sourcepub fn next(&mut self, w: &Wizard, j: &Judge<'_>) -> Result<(), String>
pub fn next(&mut self, w: &Wizard, j: &Judge<'_>) -> Result<(), String>
Next: the step shown checked, then the one after it. Refused with the first blocking problem’s message, or on the last step.
Sourcepub fn skip(&mut self, w: &Wizard, base: &WhenContext) -> Result<(), String>
pub fn skip(&mut self, w: &Wizard, base: &WhenContext) -> Result<(), String>
Skip: an optional step’s values back to their defaults, then the step after it.
Sourcepub fn back(&mut self, w: &Wizard, base: &WhenContext) -> Result<(), String>
pub fn back(&mut self, w: &Wizard, base: &WhenContext) -> Result<(), String>
Back: the step before (the last one from the summary).
Sourcepub fn go(&mut self, w: &Wizard, j: &Judge<'_>, to: &str) -> Result<(), String>
pub fn go(&mut self, w: &Wizard, j: &Judge<'_>, to: &str) -> Result<(), String>
Goes to a step (or the summary): every step before it must be valid, else it lands on the first one that is not and says why.
Sourcepub fn first_blocked(
&self,
w: &Wizard,
j: &Judge<'_>,
) -> Option<(String, Problem)>
pub fn first_blocked( &self, w: &Wizard, j: &Judge<'_>, ) -> Option<(String, Problem)>
Whether every step shown is valid: the summary may be reached and the wizard finished.
Sourcepub fn draft(&self, w: &Wizard, base: &WhenContext) -> BTreeMap<String, Value>
pub fn draft(&self, w: &Wizard, base: &WhenContext) -> BTreeMap<String, Value>
The draft handed on: the values of the fields shown in the steps
shown (a step or field whose when does not hold hands nothing).
Trait Implementations§
Source§impl Serialize for Flow
impl Serialize for Flow
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Flow
Auto Trait Implementations§
impl Freeze for Flow
impl RefUnwindSafe for Flow
impl Send for Flow
impl Sync for Flow
impl Unpin for Flow
impl UnsafeUnpin for Flow
impl UnwindSafe for Flow
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,
§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> DowncastSync for T
impl<T> DowncastSync for T
§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