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

Trait Implementations

impl Debug for PartialThingMessage
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for PartialThingMessage
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Hash for PartialThingMessage
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations