Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Typed Subscriber

The Subscriber<T> enables you to subscribe to messages of type T on a topic.

Example

#![allow(unused)]
fn main() {
use rustecal::{Ecal, EcalComponents, TypedSubscriber};
use rustecal_types_string::StringMessage;

let mut subscriber = TypedSubscriber::<StringMessage>::new("hello")?;
subscriber.set_callback(|message| {
    println!("Received: {}", message.payload.data)
}