#[non_exhaustive]pub struct HtmxRequest {
pub is_htmx: bool,
pub trigger: Option<String>,
pub target: Option<String>,
pub prompt: Option<String>,
pub current_url: Option<String>,
/* private fields */
}Expand description
Extract’s HTMX request headers to determine context and re-act re-actively.
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.is_htmx: boolTrue if the request was triggered by HTMX in the browser (HX-Request: true).
trigger: Option<String>The ID of the triggered element if sent by HTMX (HX-Trigger).
target: Option<String>The ID of the target element if sent by HTMX (HX-Target).
prompt: Option<String>The user response inputted into the prompt if sent by HTMX (HX-Prompt).
current_url: Option<String>The browser’s active URL when the request was initiated (HX-Current-URL).
Trait Implementations§
Source§impl Clone for HtmxRequest
impl Clone for HtmxRequest
Source§impl Debug for HtmxRequest
impl Debug for HtmxRequest
Source§impl<S> FromRequestParts<S> for HtmxRequest
impl<S> FromRequestParts<S> for HtmxRequest
Auto Trait Implementations§
impl Freeze for HtmxRequest
impl RefUnwindSafe for HtmxRequest
impl Send for HtmxRequest
impl Sync for HtmxRequest
impl Unpin for HtmxRequest
impl UnsafeUnpin for HtmxRequest
impl UnwindSafe for HtmxRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.