Wojciech Kozlowski
bf5bf9d8ae
Closes #48 Reviewed-on: https://git.wojciechkozlowski.eu/wojtek/musichoard/pulls/59
33 lines
994 B
Rust
33 lines
994 B
Rust
use musichoard::{database::IDatabase, library::ILibrary, Collection, MusicHoard};
|
|
|
|
#[cfg(test)]
|
|
use mockall::automock;
|
|
|
|
#[cfg_attr(test, automock)]
|
|
pub trait IMusicHoard {
|
|
fn rescan_library(&mut self) -> Result<(), musichoard::Error>;
|
|
fn load_from_database(&mut self) -> Result<(), musichoard::Error>;
|
|
fn save_to_database(&mut self) -> Result<(), musichoard::Error>;
|
|
fn get_collection(&self) -> &Collection;
|
|
}
|
|
|
|
// GRCOV_EXCL_START
|
|
impl<LIB: ILibrary, DB: IDatabase> IMusicHoard for MusicHoard<LIB, DB> {
|
|
fn rescan_library(&mut self) -> Result<(), musichoard::Error> {
|
|
MusicHoard::rescan_library(self)
|
|
}
|
|
|
|
fn load_from_database(&mut self) -> Result<(), musichoard::Error> {
|
|
MusicHoard::load_from_database(self)
|
|
}
|
|
|
|
fn save_to_database(&mut self) -> Result<(), musichoard::Error> {
|
|
MusicHoard::save_to_database(self)
|
|
}
|
|
|
|
fn get_collection(&self) -> &Collection {
|
|
MusicHoard::get_collection(self)
|
|
}
|
|
}
|
|
// GRCOV_EXCL_STOP
|