Function get_topic

Source
pub fn get_topic(
    thing_name: &str,
    api: Topic,
) -> Result<ArrayString<DEFENDER_TOPIC_MAX_LENGTH>, Error>
Expand description

Populate the topic string for a Device Defender operation.

ยงExample

use aws_iot_device_sdk_embedded::defender::Topic::*;
use aws_iot_device_sdk_embedded::{defender};

let topic = defender::get_topic("chloe", defender::Topic::JsonReportPublish).unwrap();
assert_eq!(&topic[..], "$aws/things/chloe/defender/metrics/json")