2016-04-22 13:48:59 +00:00
|
|
|
use libimagstore::store::Entry;
|
2016-08-25 18:00:17 +00:00
|
|
|
use libimagstore::storeid::StoreId;
|
2016-04-22 13:48:59 +00:00
|
|
|
|
|
|
|
pub trait IsInDiary {
|
|
|
|
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
impl IsInDiary for Entry {
|
|
|
|
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool {
|
2016-08-25 18:00:17 +00:00
|
|
|
self.get_location().clone().is_in_diary(name)
|
2016-04-22 13:48:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-08-25 18:00:17 +00:00
|
|
|
impl IsInDiary for StoreId {
|
2016-04-22 13:48:59 +00:00
|
|
|
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool {
|
2016-09-02 15:16:19 +00:00
|
|
|
use std::path::PathBuf;
|
|
|
|
self.is_in_collection(&PathBuf::from(format!("diary/{}", name)))
|
2016-04-22 13:48:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|