diff --git a/Cargo.lock b/Cargo.lock index 5f1a88b..ea30b93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -108,7 +108,7 @@ dependencies = [ [[package]] name = "pubserve" -version = "1.0.0" +version = "1.1.0-alpha.1" dependencies = [ "async-trait", "tokio", diff --git a/Cargo.toml b/Cargo.toml index da4eddc..68b1245 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pubserve" license = "MPL-2.0" -version = "1.0.0" +version = "1.1.0-alpha.1" edition = "2021" authors = ["bitfl0wer "] description = "Simple, generic observer trait." diff --git a/src/lib.rs b/src/lib.rs index abd6e31..2daf26f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. +use std::fmt::Debug; #[cfg(not(feature = "send"))] use std::rc::Rc; #[cfg(not(feature = "send"))] @@ -59,6 +60,14 @@ pub struct Publisher { subscribers: Vec>>, } +impl Debug for Publisher { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Publisher") + .field("subscribers", &self.subscribers.len()) + .finish() + } +} + impl std::default::Default for Publisher { fn default() -> Self { Self {