pub struct FormData { /* private fields */ }Expand description
Parsed application/x-www-form-urlencoded data.
Used for both URL query strings (via Request::query) and POST
request bodies (the admin layer reads form submissions this way).
Stores both a deduped key → last-value map (for the common
single-value lookup path via get) and the full
ordered pair list (for forms that submit the same key multiple
times — e.g. bulk-action checkboxes producing
ids=1&ids=2&ids=3). get_all returns every
value bound to a key.
Implementations§
Source§impl FormData
impl FormData
pub fn get(&self, key: &str) -> Option<&str>
Sourcepub fn get_all(&self, key: &str) -> Vec<&str>
pub fn get_all(&self, key: &str) -> Vec<&str>
Return every value bound to key, in submission order. Used
by bulk-action handlers to read all ids=… entries (HTML
checkbox groups send the same key once per checked row).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for FormData
impl RefUnwindSafe for FormData
impl Send for FormData
impl Sync for FormData
impl Unpin for FormData
impl UnsafeUnpin 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<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