removed default implementation of KeyDomain
This commit is contained in:
parent
1f43b186a8
commit
3e056ed63f
3 changed files with 11 additions and 3 deletions
|
|
@ -39,8 +39,6 @@ pub trait KeyDomain: Clone + std::fmt::Debug + Send + Sync {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> KeyDomain for T where T: Clone + std::fmt::Debug + Send + Sync {}
|
||||
|
||||
#[async_trait]
|
||||
pub trait KeyPoolStorage {
|
||||
type Key: ApiKey;
|
||||
|
|
|
|||
|
|
@ -502,10 +502,20 @@ pub(crate) mod test {
|
|||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
pub(crate) enum Domain {
|
||||
All,
|
||||
Guild { id: i64 },
|
||||
User { id: i32 },
|
||||
Faction { id: i32 },
|
||||
}
|
||||
|
||||
impl KeyDomain for Domain {
|
||||
fn fallback(&self) -> Option<Self> {
|
||||
match self {
|
||||
Self::Guild { id: _ } => Some(Self::All),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn setup() -> PgKeyPoolStorage<Domain> {
|
||||
INIT.call_once(|| {
|
||||
dotenv::dotenv().ok();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue