pub struct Form {
pub id: u64,
pub title: String,
pub submit: String,
pub destructive: bool,
pub ready: bool,
pub error: Option<String>,
pub from: Option<(Level, String)>,
pub fields: Vec<(String, String)>,
pub short: bool,
pub answers: Vec<String>,
pub confirm: bool,
pub tree: Node,
}Expand description
An action waiting for its arguments: the form the window shows for what the invocation still needs. The app derives its fields from the action’s parameters (each control from the parameter’s type), keeps what the person typed as their lens state, and checks each value as the action takes it; the window presents the fields (a sheet over the window, a popover at the control it came from, a sheet from the foot of a narrow window) with the title, submit and cancel, and reports edits by field.
Fields§
§id: u64Which form: edits and answers name it, so ones for a form that closed are dropped.
title: StringThe action, as its label names it (“Share…”).
submit: StringThe submit button’s label: the action’s label without its ellipsis (“Share”).
destructive: boolThe action takes something away: the submit button is destructive.
ready: boolEvery argument parses as its type: submit can be taken.
error: Option<String>Why the action refused the last submit, when that names no field.
from: Option<(Level, String)>The control that ran the action, by level and key: a popover form is anchored to it.
fields: Vec<(String, String)>Each field’s control in tree by key, in order, with the text it holds now (what the
person typed, else the default): the window shows it when the form opens.
short: boolEvery field is short (one line, a switch or a choice): a popover can hold them.
answers: Vec<String>The controls whose choice answers the form by itself, by key: a form’s quick choices, where a pick says everything the form asks, so one tap is one answer.
confirm: boolOffer the submit button: a form whose quick choices answer it needs none until the person is on the way in by hand, so its footer stands as Cancel alone.
tree: NodeThe fields, laid out: a tree of the same components and content nodes views send.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Form
impl<'de> Deserialize<'de> for Form
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>,
impl StructuralPartialEq for Form
Auto Trait Implementations§
impl Forget for Form
impl Freeze for Form
impl Move for Form
impl RefUnwindSafe for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl UnsafeUnpin for Form
impl UnwindSafe for Form
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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