Skip to content

Commit 4fe1b28

Browse files
authored
Merge pull request kayleg#24 from blinksh/master
Add attributes accessor to EncodedMessage
2 parents 5881b53 + 0c238d6 commit 4fe1b28

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/message.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ impl EncodedMessage {
2222
base64::decode(&self.data)
2323
}
2424

25+
pub fn attributes(&self) -> Option<&HashMap<String, String>> {
26+
self.attributes.as_ref()
27+
}
28+
2529
pub fn new<T: serde::Serialize>(data: &T, attributes: Option<HashMap<String, String>>) -> Self {
2630
let json = serde_json::to_string(data).unwrap();
2731
let data = base64::encode(&json);

0 commit comments

Comments
 (0)