musichoard/src/tui/lib.rs
Wojciech Kozlowski c53ba8f35f
All checks were successful
Cargo CI / Build and Test (push) Successful in 1m45s
Cargo CI / Lint (push) Successful in 1m14s
Cargo CI / Build and Test (pull_request) Successful in 1m46s
Cargo CI / Lint (pull_request) Successful in 1m16s
Break down the musichoard files (#165)
Closes #164

Reviewed-on: #165
2024-03-09 22:52:03 +01:00

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