[][src]Struct actix_storage_sled::SledStore

pub struct SledStore { /* fields omitted */ }

A simple implementation of Store based on Sled

This provider doesn't support key expiration thus Storage will return errors when trying to use methods that require expiration functionality if there is no expiry provided.

Example

use actix_storage::Storage;
use actix_storage_sled::SledStore;
use actix_web::{App, HttpServer};

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    let db = SledStore::new().expect("Error opening the database");
    let storage = Storage::build().store(db).finish();
    let server = HttpServer::new(move || {
        App::new()
            .data(storage.clone())
    });
    server.bind("localhost:5000")?.run().await
}

Implementations

impl SledStore[src]

pub fn new() -> Result<Self, SledError>[src]

pub fn from_db(db: Db) -> Self[src]

Trait Implementations

impl Debug for SledStore[src]

impl Store for SledStore[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,