Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 381 Bytes

File metadata and controls

14 lines (10 loc) · 381 Bytes

Typed Subscriber

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

Example

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)