message: Make MessagePayload a trait, and implement it on every payload.

This commit is contained in:
Emmanuel Gil Peyrot 2018-09-20 20:58:27 +02:00
commit 07cccad356
10 changed files with 36 additions and 89 deletions

View file

@ -4,12 +4,16 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use message::MessagePayload;
generate_empty_element!(
/// Requests that this message is acked by the final recipient once
/// received.
Request, "request", RECEIPTS
);
impl MessagePayload for Request {}
generate_element!(
/// Notes that a previous message has correctly been received, it is
/// referenced by its 'id' attribute.
@ -20,6 +24,8 @@ generate_element!(
]
);
impl MessagePayload for Received {}
#[cfg(test)]
mod tests {
use super::*;