use async_trait::async_trait;
use serde::{Deserialize, Serialize};
pub mod manager;
#[async_trait]
pub trait Manager {
async fn find_lib_mpath_by_url(&self, url: &str, stele: &str) -> anyhow::Result<String>;
}
#[async_trait]
pub trait TxManager {
async fn insert_bulk(&mut self, libraries: Vec<Library>) -> anyhow::Result<()>;
}
#[derive(sqlx::FromRow, Deserialize, Serialize)]
pub struct Library {
pub mpath: String,
pub url: String,
pub stele: String,
}
impl Library {
#[must_use]
pub const fn new(mpath: String, url: String, stele: String) -> Self {
Self { mpath, url, stele }
}
}