Skip to content

Commit d283298

Browse files
committed
Add attributes accessor to EncodedMessage
1 parent 5881b53 commit d283298

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
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)