Skip to content

Commit

Permalink
Fix SimpleStore trait
Browse files Browse the repository at this point in the history
  • Loading branch information
sugyan committed Sep 27, 2024
1 parent 24b6e37 commit e173c97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions atrium-oauth/oauth-client/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pub mod memory;
pub mod state;

use std::error::Error;
use std::future::Future;
use std::hash::Hash;

#[cfg_attr(not(target_arch = "wasm32"), trait_variant::make(Send))]
Expand All @@ -12,8 +13,8 @@ where
{
type Error: Error + Send + Sync + 'static;

async fn get(&self, key: &K) -> Result<Option<V>, Self::Error>;
async fn set(&self, key: K, value: V) -> Result<(), Self::Error>;
async fn del(&self, key: &K) -> Result<(), Self::Error>;
async fn clear(&self) -> Result<(), Self::Error>;
fn get(&self, key: &K) -> impl Future<Output = Result<Option<V>, Self::Error>>;
fn set(&self, key: K, value: V) -> impl Future<Output = Result<(), Self::Error>>;
fn del(&self, key: &K) -> impl Future<Output = Result<(), Self::Error>>;
fn clear(&self) -> impl Future<Output = Result<(), Self::Error>>;
}

0 comments on commit e173c97

Please sign in to comment.