Skip to main content

ContentFilteredTopic

Struct ContentFilteredTopic 

Source
pub struct ContentFilteredTopic<T: DdsType> { /* private fields */ }
Expand description

ContentFilteredTopic<T> — Sub-Topic eines Topic<T> mit Filter-Expression. Spec-Referenz: 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).”

Die Filter-Expression ist ein SQL-Subset (DDS-DCPS Annex B, BNF): field op literal-or-param, AND/OR/NOT-Komposition, parens, LIKE. Der konkrete Parser sitzt in zerodds-sql-filter.

Lifecycle: das CFT haelt einen Klon des Related-Topics (shared Arc<TopicInner>) und ist clone-bar selbst. Filter-Parameter sind veraenderbar zur Laufzeit (Spec §2.2.2.3.3.7).

Implementations§

Source§

impl<T: DdsType> ContentFilteredTopic<T>

Source

pub fn get_filter_expression(&self) -> &str

Spec §2.2.2.3.3.4 get_filter_expression.

Source

pub fn get_filter_parameters(&self) -> Vec<String>

Spec §2.2.2.3.3.5 get_filter_parameters.

Source

pub fn set_filter_parameters(&self, params: Vec<String>) -> Result<()>

Spec §2.2.2.3.3.6 set_filter_parameters. Tauscht die Parameter (gleiche Anzahl bleibt nicht erzwungen — die Spec sagt “should match the number of %n tokens” als Empfehlung, wir verifizieren das hart).

§Errors

BadParameter wenn ein %N-Index ausserhalb des neuen Vecs liegt.

Spec §2.2.2.3.3.3 get_related_topic.

Source

pub fn evaluate<R: RowAccess>(&self, row: &R) -> Result<bool>

Wertet den Filter gegen ein decodiertes Sample aus. Liefert Ok(true) wenn das Sample passieren soll, Ok(false) wenn es gefiltert wird, Err wenn die Expression auf das Row-Schema nicht passt (Caller-Entscheidung: filter denies oder error).

§Errors
  • PreconditionNotMet wenn die Filter-Parameter-Lock vergiftet ist.
  • BadParameter wenn ein Feld in der Expression im Row nicht existiert oder ein Type-Mismatch auftritt.

Trait Implementations§

Source§

impl<T: DdsType> Clone for ContentFilteredTopic<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + DdsType> Debug for ContentFilteredTopic<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: DdsType> TopicDescription for ContentFilteredTopic<T>

Source§

fn get_type_name(&self) -> &str

Type-Name kommt vom Related-Topic — ein CFT teilt sich das Schema mit dem unterliegenden Topic.

Source§

fn get_name(&self) -> &str

Topic-Name (z.B. "ChatterTopic"). Spec §2.2.2.3.1 get_name.
Source§

fn get_participant(&self) -> &DomainParticipant

Owning Participant. Spec §2.2.2.3.1 get_participant.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.