pub struct ClientSideRefresh { /* private fields */ }Expand description
Client-side “redirect:” by default, a meta refresh tag, but can be configured to return a custom response.
Implementations§
Source§impl ClientSideRefresh
impl ClientSideRefresh
Sourcepub fn from_path(path: impl AsRef<str>) -> Self
pub fn from_path(path: impl AsRef<str>) -> Self
Create a new instance, with the location to which this strategy will redirect the browser.
The redirect will be implemented as client-side “Meta Refresh” that instructs the browser to navigate to the given path immediately after loading the page.
Sourcepub fn from_body(body: impl AsRef<str>) -> Self
pub fn from_body(body: impl AsRef<str>) -> Self
Create a new instance, with the raw HTML body that will be returned to the browser in order to trigger the refresh.
Sourcepub fn with_header(
self,
name: impl Into<HeaderName>,
values: impl ToHeaderValues,
) -> Self
pub fn with_header( self, name: impl Into<HeaderName>, values: impl ToHeaderValues, ) -> Self
Adds a header to the client-side refresh response, usually in
cases where a client-side framework is using the
XMLHttpRequest or fetch APIs to send requests, and watches
for a specific response header in order to effect a client-side
redirect.
Trait Implementations§
Source§impl Debug for ClientSideRefresh
impl Debug for ClientSideRefresh
Source§impl RedirectStrategy for ClientSideRefresh
impl RedirectStrategy for ClientSideRefresh
Auto Trait Implementations§
impl Freeze for ClientSideRefresh
impl RefUnwindSafe for ClientSideRefresh
impl Send for ClientSideRefresh
impl Sync for ClientSideRefresh
impl Unpin for ClientSideRefresh
impl UnwindSafe for ClientSideRefresh
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> 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