diff options
author | Stuart Stock <stuart@int08h.com> | 2018-03-24 18:29:37 -0500 |
---|---|---|
committer | Stuart Stock <stuart@int08h.com> | 2018-03-24 18:29:37 -0500 |
commit | 806c143905778c9da3ecfafcd2a4eb4c0591cbd9 (patch) | |
tree | c178295911b5916b0a79d26a531c077475bf4f0c /src/message.rs | |
parent | e0d15dc1d9bfbd92518916dbfc306cda32c47ff3 (diff) | |
download | roughenough-806c143905778c9da3ecfafcd2a4eb4c0591cbd9.zip |
Additional documentation
Diffstat (limited to 'src/message.rs')
-rw-r--r-- | src/message.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/message.rs b/src/message.rs index f660e10..7e1175b 100644 --- a/src/message.rs +++ b/src/message.rs @@ -184,14 +184,17 @@ impl RtMessage { self.tags.len() as u32 } + /// Returns a slice of the tags in the message pub fn tags(&self) -> &[Tag] { &self.tags } + /// Returns a slice of the values in the message pub fn values(&self) -> &[Vec<u8>] { &self.values } + /// Converts the message into a `HashMap` mapping each tag to its value pub fn into_hash_map(self) -> HashMap<Tag, Vec<u8>> { self.tags.into_iter().zip(self.values.into_iter()).collect() } |