You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mediarepo/mediarepo-daemon/mediarepo-model/src/handles/mod.rs

17 lines
392 B
Rust

pub mod tag_handle;
use async_trait::async_trait;
use mediarepo_core::error::RepoResult;
use sea_orm::DatabaseConnection;
#[async_trait]
pub trait EntityHandle {
type Model;
/// Returns the ID that is stored in the handle
fn id(&self) -> i64;
/// Returns the model associated with the handle
async fn model(&self, db: DatabaseConnection) -> RepoResult<Self::Model>;
}