pub struct HxLocation {
pub uri: String,
pub options: LocationOptions,
}Expand description
The HX-Location header.
This response header can be used to trigger a client side redirection
without reloading the whole page. If you intend to redirect to a specific
target on the page, you must enable the serde feature flag and specify
LocationOptions.
Will fail if the supplied uri contains characters that are not visible ASCII (32-127).
See https://htmx.org/headers/hx-location/ for more information.
Fields§
§uri: StringUri of the new location.
options: LocationOptionsAvailable on crate feature
serde only.Extra options.
Implementations§
Source§impl HxLocation
impl HxLocation
Sourcepub fn from_str_with_options(
uri: impl AsRef<str>,
options: LocationOptions,
) -> Self
Available on crate feature serde only.
pub fn from_str_with_options( uri: impl AsRef<str>, options: LocationOptions, ) -> Self
serde only.Parses uri and sets it as location with additional options.
Trait Implementations§
Source§impl Clone for HxLocation
impl Clone for HxLocation
Source§fn clone(&self) -> HxLocation
fn clone(&self) -> HxLocation
Returns a duplicate of the value. Read more
1.0.0 · 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 HxLocation
impl Debug for HxLocation
Source§impl<'a> From<&'a str> for HxLocation
impl<'a> From<&'a str> for HxLocation
Source§impl<'a> From<(&'a str, LocationOptions)> for HxLocation
Available on crate feature serde only.
impl<'a> From<(&'a str, LocationOptions)> for HxLocation
Available on crate feature
serde only.Source§fn from((uri, options): (&'a str, LocationOptions)) -> Self
fn from((uri, options): (&'a str, LocationOptions)) -> Self
Converts to this type from the input type.
Source§impl IntoResponseParts for HxLocation
impl IntoResponseParts for HxLocation
Source§fn into_response_parts(
self,
res: ResponseParts,
) -> Result<ResponseParts, Self::Error>
fn into_response_parts( self, res: ResponseParts, ) -> Result<ResponseParts, Self::Error>
Set parts of the response
Auto Trait Implementations§
impl Freeze for HxLocation
impl RefUnwindSafe for HxLocation
impl Send for HxLocation
impl Sync for HxLocation
impl Unpin for HxLocation
impl UnwindSafe for HxLocation
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