pub struct FormValues { /* private fields */ }Expand description
Raw text values: flat fields by key, rows fields as lists of rows.
Implementations§
Source§impl FormValues
impl FormValues
Sourcepub fn normalized(&self, form: &Form) -> Self
pub fn normalized(&self, form: &Form) -> Self
A copy with every present choice value normalised; absent values stay
absent.
Source§impl FormValues
impl FormValues
Sourcepub fn from_pairs(
form: &Form,
pairs: impl IntoIterator<Item = (String, String)>,
) -> Result<Self, Vec<FieldError>>
pub fn from_pairs( form: &Form, pairs: impl IntoIterator<Item = (String, String)>, ) -> Result<Self, Vec<FieldError>>
Decode address-named fields (date, splits.0.from); a bare rows
key is the presence marker and a bare rows.i with an empty value marks
row i present. CRLF and lone CR become LF. The typed text of a select
control (label: plus its address) and its filled: mark are skipped; see crate::labels.
§Errors
Unknown or duplicate addresses and index gaps are whole-form errors
(field ""); a marker carrying text is an error at its address.
Source§impl FormValues
impl FormValues
pub fn set(&mut self, key: &str, value: &str)
Sourcepub fn set_rows(&mut self, key: &str)
pub fn set_rows(&mut self, key: &str)
Mark a rows field present, with zero rows when none are pushed.
pub fn push_row(&mut self, key: &str, row: Row)
pub fn replace_rows(&mut self, key: &str, rows: Vec<Row>)
pub fn text(&self, key: &str) -> Option<&str>
pub fn rows(&self, key: &str) -> Option<&[Row]>
Sourcepub fn check(&self, form: &Form) -> Vec<FieldError>
pub fn check(&self, form: &Form) -> Vec<FieldError>
Syntax checks only: required fields, amount and date text.
Trait Implementations§
Source§impl Clone for FormValues
impl Clone for FormValues
Source§impl Debug for FormValues
impl Debug for FormValues
Source§impl Default for FormValues
impl Default for FormValues
impl Eq for FormValues
Source§impl PartialEq for FormValues
impl PartialEq for FormValues
impl StructuralPartialEq for FormValues
Auto Trait Implementations§
impl Freeze for FormValues
impl RefUnwindSafe for FormValues
impl Send for FormValues
impl Sync for FormValues
impl Unpin for FormValues
impl UnsafeUnpin for FormValues
impl UnwindSafe for FormValues
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