Skip to main content

Session

Trait Session 

Source
pub trait Session: Send + Sync {
    // Required methods
    fn session_id(&self) -> &str;
    fn get_items(&self, limit: Option<usize>) -> SessionFuture<Vec<SessionItem>>;
    fn add_items(&self, items: Vec<SessionItem>) -> SessionFuture<()>;
    fn pop_item(&self) -> SessionFuture<Option<SessionItem>>;
    fn clear(&self) -> SessionFuture<()>;

    // Provided methods
    fn supports_add_items_once(&self) -> bool { ... }
    fn add_items_once(
        &self,
        _commit_id: String,
        _payload_digest: String,
        _items: Vec<SessionItem>,
    ) -> SessionFuture<SessionAppendOutcome> { ... }
    fn clear_session(&self) -> SessionFuture<()> { ... }
}

Required Methods§

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§