From c21bed3af90cbcfa2306a84fd1aa1ab293b9cdc4 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 22 Jan 2016 14:24:20 +0100 Subject: [PATCH 1/2] Add Entry getters --- libimagstore/src/entry.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libimagstore/src/entry.rs b/libimagstore/src/entry.rs index 682b5538..5f47dbe2 100644 --- a/libimagstore/src/entry.rs +++ b/libimagstore/src/entry.rs @@ -14,3 +14,19 @@ pub struct Entry { content: EntryContent, } +impl Entry { + + pub fn get_location(&self) -> &StoreId { + &self.location + } + + pub fn get_header(&self) -> &EntryHeader { + &self.header + } + + pub fn get_content(&self) -> &EntryContent { + &self.content + } + +} + From af411fbdb02100231b6eed6b71e00c88b95c916b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 22 Jan 2016 14:25:03 +0100 Subject: [PATCH 2/2] Add Entry mutable getters --- libimagstore/src/entry.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libimagstore/src/entry.rs b/libimagstore/src/entry.rs index 5f47dbe2..27ef3dcb 100644 --- a/libimagstore/src/entry.rs +++ b/libimagstore/src/entry.rs @@ -24,9 +24,17 @@ impl Entry { &self.header } + pub fn get_header_mut(&mut self) -> &mut EntryHeader { + &mut self.header + } + pub fn get_content(&self) -> &EntryContent { &self.content } + pub fn get_content_mut(&mut self) -> &mut EntryContent { + &mut self.content + } + }