diff options
author | Marcel Müller <m.mueller@ifm.com> | 2022-05-20 10:35:21 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@ifm.com> | 2022-05-20 12:54:00 +0200 |
commit | d3903812d74befde0271a830ba9b28ad56031c62 (patch) | |
tree | bf0af1c10614139e9ec9053b4c5ce8606bf2fa0c /crates/core/tedge_api | |
parent | a42bd5ad94527f7a30523ea78b440228127107b8 (diff) |
Add a custom debug impl for InternalMessage
Previously it also printed the 'reply_sender' which was very noisy and
provides no added information to users.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Diffstat (limited to 'crates/core/tedge_api')
-rw-r--r-- | crates/core/tedge_api/src/address.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/core/tedge_api/src/address.rs b/crates/core/tedge_api/src/address.rs index 5052d621..14d14e13 100644 --- a/crates/core/tedge_api/src/address.rs +++ b/crates/core/tedge_api/src/address.rs @@ -13,12 +13,19 @@ use crate::{ pub type AnyMessageBox = Box<dyn Message>; #[doc(hidden)] -#[derive(Debug)] pub struct InternalMessage { pub(crate) data: AnyMessageBox, pub(crate) reply_sender: tokio::sync::oneshot::Sender<AnyMessageBox>, } +impl std::fmt::Debug for InternalMessage { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("InternalMessage") + .field("data", &self.data) + .finish_non_exhaustive() + } +} + #[doc(hidden)] #[derive(Debug)] pub enum ShouldWait { |