Skip to main content

RouterBuilderSessionExt

Trait RouterBuilderSessionExt 

Source
pub trait RouterBuilderSessionExt {
    // Required method
    fn sessions(self, config: SessionConfig) -> Self;
}
Available on crate feature router only.
Expand description

Installs session support on a RouterBuilder.

Required Methods§

Source

fn sessions(self, config: SessionConfig) -> Self

Registers the session config on the app context, the root session layer, and the OriginLayer rejecting state-changing cross-origin requests (unless disabled with SessionConfigBuilder::dangerous_disable_origin_verification).

The default cookie token store also needs the cookie layer, registered with the cookie crate’s cookies extension method.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl RouterBuilderSessionExt for RouterBuilder

Source§

fn sessions(self, config: SessionConfig) -> Self

Implementors§