jwtvault 0.7.0

Highly flexible library to manage and orchestrate JWT workflow
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::prelude::*;
use std::hash::Hasher;
use std::default::Default;


pub trait PersistenceHasher<H: Hasher + Default> {
    fn engine(&self) -> H {
        H::default()
    }
}

#[async_trait]
pub trait Persistence {
    async fn store(&mut self, key: u64, value: String);
    async fn load(&self, key: u64) -> Option<&String>;
    async fn remove(&mut self, key: u64) -> Option<String>;
}