pub struct SessionLayer<S>where
S: SessionStore,{ /* private fields */ }Expand description
Session 中间件层
用于在 axum 应用中添加 Session 支持。
Implementations§
Source§impl<S> SessionLayer<S>where
S: SessionStore,
impl<S> SessionLayer<S>where
S: SessionStore,
Sourcepub fn new(store: S, config: SessionConfig) -> Self
pub fn new(store: S, config: SessionConfig) -> Self
创建新的 Session 中间件层
Sourcepub fn with_store(store: S) -> Self
pub fn with_store(store: S) -> Self
使用默认配置创建 Session 中间件层
Trait Implementations§
Source§impl<S> Clone for SessionLayer<S>where
S: SessionStore + Clone,
impl<S> Clone for SessionLayer<S>where
S: SessionStore + Clone,
Source§fn clone(&self) -> SessionLayer<S>
fn clone(&self) -> SessionLayer<S>
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<S> Debug for SessionLayer<S>where
S: SessionStore + Debug,
impl<S> Debug for SessionLayer<S>where
S: SessionStore + Debug,
Source§impl<S> Layer<Arc<SessionLayer<S>>> for SessionLayer<S>where
S: SessionStore,
impl<S> Layer<Arc<SessionLayer<S>>> for SessionLayer<S>where
S: SessionStore,
Auto Trait Implementations§
impl<S> Freeze for SessionLayer<S>where
S: Freeze,
impl<S> RefUnwindSafe for SessionLayer<S>where
S: RefUnwindSafe,
impl<S> Send for SessionLayer<S>
impl<S> Sync for SessionLayer<S>
impl<S> Unpin for SessionLayer<S>where
S: Unpin,
impl<S> UnsafeUnpin for SessionLayer<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for SessionLayer<S>where
S: UnwindSafe,
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