pub fn publish(&mut self, message: &T) {
        let tmp = mem::take(&mut self.handlers);
        for (key, handler) in tmp.into_iter() {
            if let Err(err) = handler.send(message) {
                log::error!(
                    "Failed to publish to '{}' publisher {} with error: {}",
                    self.name,
                    handler.name(),
                    err
                );
            } else {
                assert!(self.handlers.insert(key, handler).is_none());
            }
        }
    }
/// Publish a message to the subscribers.
///
/// By default, the publisher has no subscribers. Subscribers must be added before the `publish`
/// method does anything. Without subscribers, `publish` is a no-op.
///
Publish a message to the subscribers.
By default, the publisher has no subscribers. Subscribers must be added before the `publish`
method does anything. Without subscribers, `publish` is a no-op.
Publish a message to the subscribers . By default the publisher has no subscribers . Subscribers must be added before the ` publish ` method does anything . Without subscribers ` publish ` is a no - op .
pub fn publish(&mut self, message: &T) {
        let tmp = mem::take(&mut self.handlers);
        for (key, handler) in tmp.into_iter() {
            if let Err(err) = handler.send(message) {
                log::error!(
                    "Failed to publish to '{}' publisher {} with error: {}",
                    self.name,
                    handler.name(),
                    err
                );
            } else {
                assert!(self.handlers.insert(key, handler).is_none());
            }
        }
    }
pub fn publish ( & mut self , message : & T ) { let tmp = mem :: take ( & mut self . handlers ) ; for ( key , handler ) in tmp . into_iter ( ) { if let Err ( err ) = handler . send ( message ) { log :: error ! ( " " self name handler name ( ) err ) ; } else { assert ! ( self handlers insert ( key handler ) is_none ( ) ) ; } } }
Publish a message to the subscribers.
Publish a message to the subscribers .
&mut self
message
&T
&mut self
message
&T