54a0eaffeat: session storage and actor resolution1mo | 1 | use std::time::SystemTime; |
| 2 | |
| 3 | use super::RepositoryResult; |
| 4 | use crate::domain::session::{Session, SessionTokenHash}; |
| 5 | |
| 6 | |
| 7 | pub trait SessionRepository: Send + Sync { |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | fn find( |
| 13 | &self, |
| 14 | token_hash: &SessionTokenHash, |
| 15 | ) -> impl Future<Output = RepositoryResult<Option<Session>>> + Send; |
| 16 | |
| 17 | fn save(&self, session: &Session) -> impl Future<Output = RepositoryResult<()>> + Send; |
| 18 | |
| 19 | |
| 20 | fn delete( |
| 21 | &self, |
| 22 | token_hash: &SessionTokenHash, |
| 23 | ) -> impl Future<Output = RepositoryResult<()>> + Send; |
| 24 | |
| 25 | |
| 26 | fn delete_expired(&self, now: SystemTime) |
| 27 | -> impl Future<Output = RepositoryResult<u64>> + Send; |
| 28 | } |