[][src]Struct carapax_session::SessionHandler

pub struct SessionHandler<S> { /* fields omitted */ }

A session handler for carapax

This handler sets Session to context, so you can use it in your handlers:

use carapax::prelude::*;
use carapax_session::{store::redis::RedisSessionStore, Session};

fn handler(context: &mut Context, message: &Message) -> HandlerFuture {
    let session = context.get::<Session<RedisSessionStore>>();
    // do something with session...
    HandlerResult::Continue.into()
}

Methods

impl<S> SessionHandler<S> where
    S: SessionStore
[src]

pub fn new(store: S) -> Self[src]

Creates a new handler with given store

Trait Implementations

impl<S> Handler for SessionHandler<S> where
    S: SessionStore + Send + Sync + 'static, 
[src]

type Input = Update

An object to handle (update, message, inline query, etc...) Read more

type Output = ()

A result or future to return Read more

Auto Trait Implementations

impl<S> Send for SessionHandler<S> where
    S: Send + Sync

impl<S> Sync for SessionHandler<S> where
    S: Send + Sync

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Erased for T