is_system_topic

Function is_system_topic 

Source
pub fn is_system_topic<T: AsRef<str>>(topic: T) -> bool
Expand description

Determines if a topic name represents a system topic.

MQTT system topics are reserved for broker-specific functionality and typically start with the $ character. Clients should generally avoid publishing to system topics unless specifically documented by the broker.

ยงExample

use mqute_codec::protocol::util;

assert!(util::is_system_topic("$SYS/monitor"));
assert!(!util::is_system_topic("sensors/temperature"));