pub struct FormExport(/* private fields */);Expand description
After form is submitted, it generates an export from every field. This can be used to construct a new model.
Implementations§
Source§impl FormExport
impl FormExport
pub fn new(map: HashMap<String, FieldExport>) -> Self
pub fn get<'a>(&'a self, key: &str) -> Option<&'a FieldExport>
Sourcepub fn get_string(&self, key: &str) -> String
pub fn get_string(&self, key: &str) -> String
Get value from string input.
Sourcepub fn get_string_opt(&self, key: &str) -> Option<String>
pub fn get_string_opt(&self, key: &str) -> Option<String>
Get value from string input or None if empty.
pub fn list<T: From<String>>(&self, key: &str) -> Option<T>
pub fn list_or_default<T: Default + From<String>>(&self, key: &str) -> T
pub fn dict_or_default<T: From<i64>>(&self, key: &str) -> T
pub fn multi<T: From<i64>>(&self, key: &str) -> Vec<T>
Sourcepub fn get_bool_opt(&self, key: &str) -> Option<bool>
pub fn get_bool_opt(&self, key: &str) -> Option<bool>
Get value from bool input (i. e. checkbox) or None.
pub fn image_url(&self, key: &str) -> String
pub fn image_url_opt(&self, key: &str) -> Option<String>
pub fn image_item_opt(&self, key: &str) -> Option<DropFileItem>
pub fn image_orig_url_opt(&self, key: &str) -> Option<Rc<String>>
Trait Implementations§
Source§impl Clone for FormExport
impl Clone for FormExport
Source§fn clone(&self) -> FormExport
fn clone(&self) -> FormExport
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FormExport
impl RefUnwindSafe for FormExport
impl !Send for FormExport
impl !Sync for FormExport
impl Unpin for FormExport
impl UnwindSafe for FormExport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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