async_trait creates an AsyncResovlver, that can live along-side Resolver
This commit is contained in:
parent
42bfd3efb0
commit
7df1cbe7ba
2 changed files with 4 additions and 6 deletions
|
@ -6,7 +6,7 @@ use async_trait::async_trait;
|
|||
/// The `R` type is your resource repository (a database for instance) that will be passed to the
|
||||
/// [`find`](Resolver::find) and [`endpoint`](Resolver::endpoint) functions.
|
||||
#[async_trait]
|
||||
pub trait Resolver {
|
||||
pub trait AsyncResolver {
|
||||
type Repo: Send;
|
||||
/// Returns the domain name of the current instance.
|
||||
async fn instance_domain<'a>(&self) -> &'a str;
|
||||
|
|
|
@ -5,16 +5,14 @@
|
|||
use reqwest::{header::ACCEPT, Client};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
mod sync_trait;
|
||||
pub use crate::sync_trait::*;
|
||||
|
||||
#[cfg(feature = "async")]
|
||||
mod async_trait;
|
||||
#[cfg(feature = "async")]
|
||||
pub use crate::async_trait::*;
|
||||
|
||||
#[cfg(not(feature = "async"))]
|
||||
mod sync_trait;
|
||||
#[cfg(not(feature = "async"))]
|
||||
pub use crate::sync_trait::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
|
|
Loading…
Reference in a new issue