pub fn publish<T>(&mut self, topic_name: &str, event: T) -> Result<(), EventError>
    where
        T: ser::Serialize, {
        if !self.topics.contains_key(topic_name) {
            Err(EventError::TopicDoesNotExist)
        } else {
            let message = to_string(&event).unwrap();
            self.topics
                .get_mut(topic_name)
                .expect("A topic is missing, but is identified as existing")
                .publish(message);
            Ok(())
        }
    }
/// Publish an event into the topic `topic_name`
Publish an event into the topic `topic_name`
Publish an event into the topic ` topic_name `
pub fn publish<T>(&mut self, topic_name: &str, event: T) -> Result<(), EventError>
    where
        T: ser::Serialize, {
        if !self.topics.contains_key(topic_name) {
            Err(EventError::TopicDoesNotExist)
        } else {
            let message = to_string(&event).unwrap();
            self.topics
                .get_mut(topic_name)
                .expect("A topic is missing, but is identified as existing")
                .publish(message);
            Ok(())
        }
    }
pub fn publish < T > ( & mut self , topic_name : & str , event : T ) -> Result < ( ) , EventError > where T : ser :: Serialize , { if ! self . topics . contains_key ( topic_name ) { Err ( EventError :: TopicDoesNotExist ) } else { let message = to_string ( & event ) . unwrap ( ) ; self . topics . get_mut ( topic_name ) . expect ( " " ) . publish ( message ) ; Ok ( ( ) ) } }
Publish an event into the topic `topic_name`
Publish an event into the topic ` topic_name `
&mut self
topic_name
&str
event
T
&mut self
topic_name
&str
event
T