pub trait TopicValidator: Send + Sync {
// Required methods
fn validate_topic_name(&self, topic: &str) -> Result<()>;
fn validate_topic_filter(&self, filter: &str) -> Result<()>;
fn is_reserved_topic(&self, topic: &str) -> bool;
fn description(&self) -> &'static str;
}Expand description
Trait for pluggable topic validation
This trait allows customization of topic validation rules beyond the standard MQTT specification. Implementations can add additional restrictions, reserved topic prefixes, or cloud provider-specific rules.
Required Methods§
Sourcefn validate_topic_name(&self, topic: &str) -> Result<()>
fn validate_topic_name(&self, topic: &str) -> Result<()>
Sourcefn validate_topic_filter(&self, filter: &str) -> Result<()>
fn validate_topic_filter(&self, filter: &str) -> Result<()>
Sourcefn is_reserved_topic(&self, topic: &str) -> bool
fn is_reserved_topic(&self, topic: &str) -> bool
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Gets a human-readable description of the validator