diff --git a/parsers/src/message.rs b/parsers/src/message.rs index e03578f..c0621f8 100644 --- a/parsers/src/message.rs +++ b/parsers/src/message.rs @@ -154,6 +154,18 @@ impl Message { self } + /// Set a payload inside this message. + pub fn with_payload(mut self, payload: P) -> Message { + self.payloads.push(payload.into()); + self + } + + /// Set the payloads of this message. + pub fn with_payloads(mut self, payloads: Vec) -> Message { + self.payloads = payloads; + self + } + fn get_best<'a, T>( map: &'a BTreeMap, preferred_langs: Vec<&str>,