diff --git a/libimaglink/src/internal.rs b/libimaglink/src/internal.rs index bfee3c64..39750fae 100644 --- a/libimaglink/src/internal.rs +++ b/libimaglink/src/internal.rs @@ -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 { + self.get_header().get_internal_links() + } + + fn set_internal_links(&mut self, links: Links) -> Result { + 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>) -> Result { if links.is_err() { let lerr = LinkError::new(LinkErrorKind::EntryHeaderReadError,