31 lines
971 B
Rust
31 lines
971 B
Rust
use musichoard::{
|
|
collection::Collection, interface::database::IDatabase, interface::library::ILibrary,
|
|
IMusicHoardBase, IMusicHoardDatabase, IMusicHoardLibrary, MusicHoard,
|
|
};
|
|
|
|
#[cfg(test)]
|
|
use mockall::automock;
|
|
|
|
#[cfg_attr(test, automock)]
|
|
pub trait IMusicHoard {
|
|
fn rescan_library(&mut self) -> Result<(), musichoard::Error>;
|
|
fn reload_database(&mut self) -> Result<(), musichoard::Error>;
|
|
fn get_collection(&self) -> &Collection;
|
|
}
|
|
|
|
// GRCOV_EXCL_START
|
|
impl<Database: IDatabase, Library: ILibrary> IMusicHoard for MusicHoard<Database, Library> {
|
|
fn rescan_library(&mut self) -> Result<(), musichoard::Error> {
|
|
<Self as IMusicHoardLibrary>::rescan_library(self)
|
|
}
|
|
|
|
fn reload_database(&mut self) -> Result<(), musichoard::Error> {
|
|
<Self as IMusicHoardDatabase>::reload_database(self)
|
|
}
|
|
|
|
fn get_collection(&self) -> &Collection {
|
|
<Self as IMusicHoardBase>::get_collection(self)
|
|
}
|
|
}
|
|
// GRCOV_EXCL_STOP
|