pub fn match_topic<'a>(topic: &'a str) -> Result<ThingShadow<'_>, Error>
Expand description
Given the topic string of an incoming message, determine whether it is related to a device shadow;
If it is, return information about the type of device shadow message, and the Thing Name and Shadow Name inside of the topic string.
ยงExample
use aws_iot_device_sdk_embedded_rust::shadow::Topic::*;
use aws_iot_device_sdk_embedded_rust::{shadow};
let topic = "$aws/things/chloe/shadow/name/common/get/rejected";
let shadow = shadow::match_topic(topic).unwrap();
assert_eq!(shadow.thing_name, "chloe");
assert_eq!(shadow.shadow_name.unwrap(), "common");
assert_eq!(shadow.shadow_op, shadow::Topic::GetRejected);