Implement InternalLinker for Entry, for convenience

This commit is contained in:
Matthias Beyer 2016-02-15 13:27:40 +01:00
parent defec535c8
commit d6029678c7

View file

@ -1,3 +1,4 @@
use libimagstore::store::Entry;
use libimagstore::store::EntryHeader;
use libimagstore::store::Result as StoreResult;
@ -54,6 +55,25 @@ impl InternalLinker for EntryHeader {
}
impl InternalLinker for Entry {
fn get_internal_links(&self) -> Result<Links> {
self.get_header().get_internal_links()
}
fn set_internal_links(&mut self, links: Links) -> Result<Links> {
self.get_header_mut().set_internal_links(links)
}
fn add_internal_link(&mut self, link: Link) -> Result<()> {
self.get_header_mut().add_internal_link(link)
}
fn remove_internal_link(&mut self, link: Link) -> Result<()> {
self.get_header_mut().remove_internal_link(link)
}
}
fn process_rw_result(links: StoreResult<Option<Value>>) -> Result<Links> {
if links.is_err() {
let lerr = LinkError::new(LinkErrorKind::EntryHeaderReadError,