#[non_exhaustive]pub struct FormResponse {
pub location: Option<String>,
pub status: StatusCode,
pub body: String,
}Expand description
The answer to a form or multipart request. A redirect is captured rather than followed,
so a 302 or 303 arrives here with its Location intact; an endpoint reached on a
.json path answers the record itself, which lands in body instead.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.location: Option<String>Where the redirect pointed, exactly as HEY wrote it — often a path rather than a whole URL.
status: StatusCodeThe status the endpoint answered: a 302 or 303 for a redirect, a 200 for a document.
body: StringWhat the endpoint answered when it answered a document instead of a redirect.
Implementations§
Source§impl FormResponse
impl FormResponse
Sourcepub fn extract_id(&self) -> Result<i64, Error>
pub fn extract_id(&self) -> Result<i64, Error>
The id of the record the redirect named: the rightmost path segment that reads as a
number, so /calendar/events/42 and /calendar/events/42/edit both answer 42.
Trait Implementations§
Source§impl Clone for FormResponse
impl Clone for FormResponse
Source§fn clone(&self) -> FormResponse
fn clone(&self) -> FormResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FormResponse
impl Debug for FormResponse
impl Eq for FormResponse
Source§impl PartialEq for FormResponse
impl PartialEq for FormResponse
impl StructuralPartialEq for FormResponse
Auto Trait Implementations§
impl Freeze for FormResponse
impl RefUnwindSafe for FormResponse
impl Send for FormResponse
impl Sync for FormResponse
impl Unpin for FormResponse
impl UnsafeUnpin for FormResponse
impl UnwindSafe for FormResponse
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§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.