pub struct RequestInfo {
pub method: Method,
pub url: String,
pub referer: Option<String>,
pub is_inertia: bool,
pub client_version: Option<String>,
pub partial_component: Option<String>,
pub partial_only: HashSet<String>,
pub partial_except: HashSet<String>,
pub reset: HashSet<String>,
}Expand description
Request information needed to drive the Inertia protocol.
Fields§
§method: MethodHTTP method.
url: StringFull URL the client is currently at (path + query).
referer: Option<String>Value of the Referer header, if present.
Used by crate::inertia::Inertia::back() to redirect the client to the
previous page. Falls back to "/" when absent.
is_inertia: booltrue iff X-Inertia: true was set.
client_version: Option<String>Client-reported asset version, if any.
partial_component: Option<String>Component being partially reloaded, if any.
partial_only: HashSet<String>Allowlist of prop keys for a partial reload.
partial_except: HashSet<String>Denylist of prop keys for a partial reload.
reset: HashSet<String>Keys the client wants reset (clear merge state for these).
Implementations§
Source§impl RequestInfo
impl RequestInfo
Sourcepub fn from_parts(method: Method, url: String, headers: &HeaderMap) -> Self
pub fn from_parts(method: Method, url: String, headers: &HeaderMap) -> Self
Parse headers + method + url into a RequestInfo.
Sourcepub fn is_partial(&self) -> bool
pub fn is_partial(&self) -> bool
Returns true if the request is a partial reload (component header set + only/except non-empty).
Trait Implementations§
Source§impl Clone for RequestInfo
impl Clone for RequestInfo
Source§fn clone(&self) -> RequestInfo
fn clone(&self) -> RequestInfo
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 moreAuto Trait Implementations§
impl Freeze for RequestInfo
impl RefUnwindSafe for RequestInfo
impl Send for RequestInfo
impl Sync for RequestInfo
impl Unpin for RequestInfo
impl UnsafeUnpin for RequestInfo
impl UnwindSafe for RequestInfo
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