diff options
author | Hendrik Sollich <hendrik@hoodie.de> | 2016-11-11 22:09:32 +0100 |
---|---|---|
committer | Hendrik Sollich <hendrik@hoodie.de> | 2016-11-11 22:09:32 +0100 |
commit | 4ed3dffa2fc4fc2a3c1f263e00620f769b35411f (patch) | |
tree | 13a1a4a9e88256148f58441c74a4377ef034a218 /src | |
parent | d90a88b58876bf63da588eb1dd0ab4e9f058e2e5 (diff) |
correct Component types
Diffstat (limited to 'src')
-rw-r--r-- | src/components.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/components.rs b/src/components.rs index 3b5ac42..640c4e4 100644 --- a/src/components.rs +++ b/src/components.rs @@ -103,14 +103,17 @@ pub trait Component { Ok(()) } + /// Set the summary fn summary(&mut self, desc: &str) -> &mut Self { self.add_property("SUMMARY", desc) } + /// Set the description fn description(&mut self, desc: &str) -> &mut Self { self.add_property("DESCRIPTION", desc) } + /// Set the visibility class fn class(&mut self, class: Class) -> &mut Self { self.append_property(class.into()) } @@ -119,8 +122,12 @@ pub trait Component { macro_rules! component_impl { ($t:ty, $kind:expr) => { impl Component for $t { + /// Tells you what kind of `Component` this is + /// + /// Might be `VEVENT`, `VTODO`, `VALARM` etc fn component_kind() -> &'static str { $kind } + /// Read-only access to properties fn properties<'a>(&'a self) -> &'a HashMap<String, Property>{ &self.properties } |