#[async_trait]
#[allow(missing_docs)]
pub trait AnimeRepository {
type SearchResult;
type Identifier;
type Episode;
type Detail;
type Link;
async fn search(&self, query: &str) -> Result<Self::SearchResult>;
async fn list_eps(&self, _: Self::Identifier) -> Result<Vec<Self::Episode>>;
async fn detail(&self, _: Self::Episode) -> Result<Self::Detail>;
async fn watch_link(&self, _: Self::Episode) -> Result<Self::Link>;
}
#[derive(Debug)]
pub enum AnimeRepositoryError {
NotFound,
Unsupported,
DatasourceError,
}
pub type Result<T> = std::result::Result<T, AnimeRepositoryError>;