pub struct FormData { /* private fields */ }
Implementations§
Source§impl FormData
impl FormData
Sourcepub fn new(event: impl HasFormData + 'static) -> Self
pub fn new(event: impl HasFormData + 'static) -> Self
Create a new form event
Sourcepub fn parsed<T>(&self) -> Result<T, T::Err>where
T: FromStr,
pub fn parsed<T>(&self) -> Result<T, T::Err>where
T: FromStr,
Get the value of the form event as a parsed type
Sourcepub fn checked(&self) -> bool
pub fn checked(&self) -> bool
Try to parse the value as a boolean
Returns false if the value is not a boolean, or if it is false! Does not verify anything about the event itself, use with caution
Sourcepub fn values(&self) -> HashMap<String, FormValue>
pub fn values(&self) -> HashMap<String, FormValue>
Collect all the named form values from the containing form.
Every input must be named!
Sourcepub fn files(&self) -> Option<Arc<dyn FileEngine>>
pub fn files(&self) -> Option<Arc<dyn FileEngine>>
Get the files of the form event
Source§impl FormData
impl FormData
Sourcepub fn parsed_values<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn parsed_values<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
Parse the values into a struct with one field per value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FormData
impl<'de> Deserialize<'de> for FormData
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&PlatformEventData> for FormData
impl From<&PlatformEventData> for FormData
Source§fn from(val: &PlatformEventData) -> Self
fn from(val: &PlatformEventData) -> Self
Converts to this type from the input type.
Source§impl<E: HasFormData> From<E> for FormData
impl<E: HasFormData> From<E> for FormData
Source§impl HasFileData for FormData
impl HasFileData for FormData
Auto Trait Implementations§
impl Freeze for FormData
impl !RefUnwindSafe for FormData
impl !Send for FormData
impl !Sync for FormData
impl Unpin for FormData
impl !UnwindSafe for FormData
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> 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<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.