25 lines
419 B
Rust
25 lines
419 B
Rust
use libimagstore::store::Entry;
|
|
use libimagstore::storeid::StoreId;
|
|
|
|
pub trait IsInDiary {
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool;
|
|
|
|
}
|
|
|
|
impl IsInDiary for Entry {
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool {
|
|
self.get_location().clone().is_in_diary(name)
|
|
}
|
|
|
|
}
|
|
|
|
impl IsInDiary for StoreId {
|
|
|
|
fn is_in_diary(&self, name: &str) -> bool {
|
|
self.is_in_collection(&["diary", name])
|
|
}
|
|
|
|
}
|
|
|