pub struct Form {
pub verdict: Verdict,
pub fields: Vec<Field>,
pub selected: usize,
pub error: Option<String>,
}Fields§
§verdict: Verdict§fields: Vec<Field>§selected: usizeThe selected row of Form::rows.
error: Option<String>The last local or human::submit error.
Implementations§
Source§impl Form
impl Form
Sourcepub fn new(verdict: Verdict, schema: Option<&Value>) -> Result<Self, String>
pub fn new(verdict: Verdict, schema: Option<&Value>) -> Result<Self, String>
The form of verdict for its owner schema, or none. A schema a form cannot enter is
refused, as check refuses it when the declaration loads.
Sourcepub fn result(&self) -> Result<Value, String>
pub fn result(&self) -> Result<Value, String>
The complete result: owner fields plus the chosen verdict.
Sourcepub fn add(&mut self, index: usize)
pub fn add(&mut self, index: usize)
Add an empty item to the list of field index: an empty text to a list of strings, an
empty group to a list of groups, which the selection moves into.
Sourcepub fn remove(&mut self, index: usize, item: usize)
pub fn remove(&mut self, index: usize, item: usize)
Remove item item of the list of field index; one empty item always stays to type in.
Sourcepub fn remove_selected(&mut self)
pub fn remove_selected(&mut self)
Remove the group the selection is in.
Sourcepub fn paste(&mut self, text: &str)
pub fn paste(&mut self, text: &str)
Bounded paste follows the existing Human result limit, without splitting UTF-8.
Sourcepub fn inline_key(&mut self, key: Key, modified: bool)
pub fn inline_key(&mut self, key: Key, modified: bool)
A key typed into the form. Enter never submits: on + Add it adds a group, in a list
it starts the next item. Keys with Control or Alt are not the form’s.