match_topic

Function match_topic 

Source
pub fn match_topic(topic: &str) -> Result<ThingJobs<'_>, Error>
Expand description

Output a topic value if a Jobs API topic string is present. Optionally, output a jobID and thing name within the topic.

ยงExample

use aws_iot_device_sdk_embedded_rust::jobs::Topic::*;
use aws_iot_device_sdk_embedded_rust::{jobs};

let jobs = jobs::match_topic("$aws/things/chloe/jobs/$next/get/accepted").unwrap();
assert_eq!(jobs.api, jobs::Topic::DescribeSuccess);
let id = jobs.id.unwrap();
assert_eq!(&id[..], "$next")