pub struct Inertia { /* private fields */ }Expand description
The entrypoint to Inertia that is used by route handlers and response mapping middleware.
Implementations§
Source§impl Inertia
impl Inertia
Sourcepub fn render(
self,
component: &'static str,
) -> PropChain<impl Future<Output = Response>>
pub fn render( self, component: &'static str, ) -> PropChain<impl Future<Output = Response>>
Render the current page with whatever props you have set.
NOTE: this will not immediately render as you may have some share middleware that will still be able to morph the response structure.
Produce a response that shares all of your props.
Sourcepub fn back(self) -> PropChain<FlashedResponse>
pub fn back(self) -> PropChain<FlashedResponse>
Redirects you and returns you back to the referrer. Any props set automatically will become flashed.
pub fn set_version(&self, version: &'static str)
Sourcepub fn version(&self) -> Option<&str>
pub fn version(&self) -> Option<&str>
Provides the current version, used for defining cache busting in your versioning provider
pub fn set_html_sandwich(&self, head: String, tail: String)
Sourcepub fn set_flash_props_for_next_request(&self, cb: impl FnOnce(Value))
pub fn set_flash_props_for_next_request(&self, cb: impl FnOnce(Value))
Set flash props on the request / response for the next request
Sourcepub fn apply_flash_props(&self, flash_props: Value)
pub fn apply_flash_props(&self, flash_props: Value)
Apply flash props to the current request
Sourcepub fn next_response(self, res: Response) -> Response
pub fn next_response(self, res: Response) -> Response
When using response middleware to modify the response, you must use this so that the correct continuation data goes through to allow inertia to work