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§
Sourcefn get_string(&self) -> Option<String>
fn get_string(&self) -> Option<String>
Extracts the string value.
Sourcefn parse_uuid(&self) -> Option<Result<Uuid, Error>>
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
.
Sourcefn parse_date(&self) -> Option<Result<Date, ParseError>>
fn parse_date(&self) -> Option<Result<Date, ParseError>>
Parses the string value as Date
.
Sourcefn parse_time(&self) -> Option<Result<Time, ParseError>>
fn parse_time(&self) -> Option<Result<Time, ParseError>>
Parses the string value as Time
.
Sourcefn parse_date_time(&self) -> Option<Result<DateTime, ParseError>>
fn parse_date_time(&self) -> Option<Result<DateTime, ParseError>>
Parses the string value as DateTime
.
Sourcefn parse_duration(&self) -> Option<Result<Duration, ParseDurationError>>
fn parse_duration(&self) -> Option<Result<Duration, ParseDurationError>>
Parses the string value as Duration
.
Sourcefn read_as_model<M: Model>(&self) -> Result<M, Validation>
fn read_as_model<M: Model>(&self) -> Result<M, Validation>
Attempts to read the map as an instance of the model M
.
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.