Function send

Source
pub fn send(options: &SendOptions, tether_agent: &mut TetherAgent) -> Result<()>
Examples found in repository?
examples/api.rs (line 47)
27fn demo_send() {
28    let mut tether_agent = TetherAgentOptionsBuilder::new("demoSend")
29        .build()
30        .expect("failed to init/connect Tether Agent");
31
32    let mut count = 0;
33
34    let options = SendOptions {
35        plug_name: Some("dummyData".into()),
36        plug_topic: None,
37        plug_id: None,
38        plug_role: None,
39        message_payload_json: None,
40        use_dummy_data: true,
41    };
42
43    loop {
44        std::thread::sleep(std::time::Duration::from_secs(1));
45        count += 1;
46        println!("SEND: sending message #{}", count);
47        send(&options, &mut tether_agent).expect("failed to send");
48    }
49}