inertia_rust

Trait InertiaService

Source
pub trait InertiaService {
    // Required method
    fn inertia_route<T>(self, path: &str, component: &'static str) -> Self
       where T: 'static;
}
Expand description

InertiaService trait define a method to be implemented to Inertia struct that allows to generate simple routes directly, without needing to create a handler function.

Required Methods§

Source

fn inertia_route<T>(self, path: &str, component: &'static str) -> Self
where T: 'static,

Renders an Inertia component directly, without defining a specific handler function for it.

§Arguments
  • path - The router path.
  • component - The component to be rendered.
§Examples
use some_framework::App;

App::new().inertia_route("/", "Index");

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<TApp> InertiaService for App<TApp>
where TApp: ServiceFactory<ServiceRequest, Config = (), Error = Error, InitError = ()>,

Source§

fn inertia_route<T>(self, path: &str, component: &'static str) -> Self
where T: 'static,

Implementors§