pub struct ContentFilteredTopic<T: DdsType> { /* private fields */ }Expand description
ContentFilteredTopic<T> — a sub-topic of a Topic<T> with a filter
expression. Spec reference: OMG DDS 1.4 §2.2.2.3.3.
“ContentFilteredTopic is a specialization of TopicDescription that allows for content-based subscriptions. The selection of the content is done using a filter_expression with parameters (filter_parameters).”
The filter expression is a SQL subset (DDS-DCPS Annex B, BNF):
field op literal-or-param, AND/OR/NOT composition, parens,
LIKE. The concrete parser lives in zerodds-sql-filter.
Lifecycle: the CFT holds a clone of the related topic (shared
Arc<TopicInner>) and is itself cloneable. Filter parameters are
mutable at runtime (spec §2.2.2.3.3.7).
Implementations§
Source§impl<T: DdsType> ContentFilteredTopic<T>
impl<T: DdsType> ContentFilteredTopic<T>
Sourcepub fn get_filter_expression(&self) -> &str
pub fn get_filter_expression(&self) -> &str
Spec §2.2.2.3.3.4 get_filter_expression.
Sourcepub fn get_filter_parameters(&self) -> Vec<String>
pub fn get_filter_parameters(&self) -> Vec<String>
Spec §2.2.2.3.3.5 get_filter_parameters.
Sourcepub fn set_filter_parameters(&self, params: Vec<String>) -> Result<()>
pub fn set_filter_parameters(&self, params: Vec<String>) -> Result<()>
Spec §2.2.2.3.3.6 set_filter_parameters. Swaps the parameters
(equal count is not enforced — the spec says “should match the
number of %n tokens” as a recommendation; we verify it
strictly).
§Errors
BadParameter if a %N index is outside the new vec.
Spec §2.2.2.3.3.3 get_related_topic.
Sourcepub fn evaluate<R: RowAccess>(&self, row: &R) -> Result<bool>
pub fn evaluate<R: RowAccess>(&self, row: &R) -> Result<bool>
Evaluates the filter against a decoded sample. Returns
Ok(true) if the sample should pass, Ok(false) if it is
filtered out, Err if the expression does not fit the row schema
(caller’s decision: filter denies or error).
§Errors
PreconditionNotMetif the filter-parameter lock is poisoned.BadParameterif a field in the expression does not exist in the row or a type mismatch occurs.
Trait Implementations§
Source§impl<T: DdsType> Clone for ContentFilteredTopic<T>
impl<T: DdsType> Clone for ContentFilteredTopic<T>
Source§impl<T: DdsType> TopicDescription for ContentFilteredTopic<T>
impl<T: DdsType> TopicDescription for ContentFilteredTopic<T>
Source§fn get_type_name(&self) -> &str
fn get_type_name(&self) -> &str
The type name comes from the related topic — a CFT shares the schema with the underlying topic.
Source§fn get_participant(&self) -> &DomainParticipant
fn get_participant(&self) -> &DomainParticipant
get_participant.