zino_dioxus::extension

Trait FormDataExt

Source
pub trait FormDataExt {
    // Required methods
    fn get_string(&self) -> Option<String>;
    fn parse_uuid(&self) -> Option<Result<Uuid, Error>>;
    fn parse_decimal(&self) -> Option<Result<Decimal, Error>>;
    fn parse_date(&self) -> Option<Result<Date, ParseError>>;
    fn parse_time(&self) -> Option<Result<Time, ParseError>>;
    fn parse_date_time(&self) -> Option<Result<DateTime, ParseError>>;
    fn parse_duration(&self) -> Option<Result<Duration, ParseDurationError>>;
    fn read_as_model<M: Model>(&self) -> Result<M, Validation>;
    fn to_map(&self) -> Map;
}
Expand description

Extension trait for FormData.

Required Methods§

Source

fn get_string(&self) -> Option<String>

Extracts the string value.

Source

fn parse_uuid(&self) -> Option<Result<Uuid, Error>>

Extracts the string value and parses it as Uuid. If the Uuid is nil, it also returns None.

Source

fn parse_decimal(&self) -> Option<Result<Decimal, Error>>

Parses the JSON value as Decimal.

Source

fn parse_date(&self) -> Option<Result<Date, ParseError>>

Parses the string value as Date.

Source

fn parse_time(&self) -> Option<Result<Time, ParseError>>

Parses the string value as Time.

Source

fn parse_date_time(&self) -> Option<Result<DateTime, ParseError>>

Parses the string value as DateTime.

Source

fn parse_duration(&self) -> Option<Result<Duration, ParseDurationError>>

Parses the string value as Duration.

Source

fn read_as_model<M: Model>(&self) -> Result<M, Validation>

Attempts to read the map as an instance of the model M.

Source

fn to_map(&self) -> Map

Converts self to a JSON object.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FormDataExt for FormData

Implementors§