use async_trait::async_trait;
use crate::error::Error;
#[cfg(feature = "saucenao")]
pub mod saucenao;
#[cfg(feature = "iqdb")]
pub mod iqdb;
#[async_trait]
pub trait Source
where
Self: Sized,
{
type Argument;
async fn check(&self, url: &str) -> Result<Output, Error>;
async fn create(argument: Self::Argument) -> Result<Self, Error>;
}
#[derive(Debug, Clone)]
pub struct Output {
pub original_url: String,
pub items: Vec<Item>,
}
#[derive(Debug, Clone)]
pub struct Item {
pub link: String,
pub similarity: f32,
}