From 5adc8504beacb6b3564685c398b9b3d90a5938fc Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 15 Feb 2016 14:09:11 +0100 Subject: [PATCH] Impl Tagable for Entry for convenience --- libimagtag/src/tagable.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libimagtag/src/tagable.rs b/libimagtag/src/tagable.rs index 1ad7da7e..3eca3856 100644 --- a/libimagtag/src/tagable.rs +++ b/libimagtag/src/tagable.rs @@ -114,3 +114,30 @@ impl Tagable for EntryHeader { } +impl Tagable for Entry { + + fn get_tags(&self) -> Result> { + self.get_header().get_tags() + } + + fn set_tags(&mut self, ts: Vec) -> Result<()> { + self.get_header_mut().set_tags(ts) + } + + fn add_tag(&mut self, t: Tag) -> Result<()> { + self.get_header_mut().add_tag(t) + } + + fn remove_tag(&mut self, t: Tag) -> Result<()> { + self.get_header_mut().remove_tag(t) + } + + fn has_tag(&self, t: &Tag) -> Result { + self.get_header().has_tag(t) + } + + fn has_tags(&self, ts: &Vec) -> Result { + self.get_header().has_tags(ts) + } + +}