Struct hub_sdk::PartialThingMessage
[−]
[src]
pub struct PartialThingMessage { pub topic: String, pub msg: String, }
Structure to contain a message to be sent to or received from the Geeny Cloud
Does not contain the Serial Number or ThingId
of the device in question.
Please see HubSDK::send_messages
and HubSDK::receive_messages
for further
examples of usage
use hub_sdk::{HubSDK, HubSDKConfig, PartialThingMessage}; let sdk_cfg = HubSDKConfig::default(); let hub_sdk = HubSDK::new(sdk_cfg); let messages = vec!( PartialThingMessage { topic: "demo/send/path".into(), msg: "demonstration message".into(), }, PartialThingMessage { topic: "demo/other/path".into(), msg: "second demonstration message".into(), }, ); hub_sdk.send_messages("ABC123456", &messages) .expect("Failed to send messages!");
Fields
topic: String
msg: String
Trait Implementations
impl Debug for PartialThingMessage
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for PartialThingMessage
[src]
fn clone(&self) -> PartialThingMessage
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more