pub struct FormInput(/* private fields */);Expand description
Submitted form values, by field name. Empty fields are None.
Implementations§
Source§impl FormInput
impl FormInput
Sourcepub fn new(values: HashMap<String, String>) -> Self
pub fn new(values: HashMap<String, String>) -> Self
Wraps the values of a submitted form, keyed by field name.
Sourcepub fn get(&self, name: &str) -> Option<&str>
pub fn get(&self, name: &str) -> Option<&str>
Returns the value of name, or None when the field is missing or
blank. The value is not trimmed.
Sourcepub fn has(&self, name: &str) -> bool
pub fn has(&self, name: &str) -> bool
Returns true when the form sent the field name at all, even blank. A field that is
sent blank is one the user cleared; a field that is not sent is one the form does not
have, so an update keeps its stored value. An unticked HTML checkbox sends nothing, so
use checkbox for a checkbox, not this.
Trait Implementations§
impl Eq for FormInput
impl StructuralPartialEq for FormInput
Auto Trait Implementations§
impl Forget for FormInput
impl Freeze for FormInput
impl Move for FormInput
impl RefUnwindSafe for FormInput
impl Send for FormInput
impl Sync for FormInput
impl Unpin for FormInput
impl UnsafeUnpin for FormInput
impl UnwindSafe for FormInput
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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