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-08-28 12:18:29 +00:00
|
|
|
self.is_in_collection(&["diary", name])
|
2016-04-22 13:48:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|