Skip to main content

Matcher

Trait Matcher 

Source
pub trait Matcher<T>: PartialEq<T> {
    // Required method
    fn value(&self) -> Option<&T>;
}
Expand description

A trait for pattern matching against RDF components.

This trait enables flexible matching of RDF terms, subjects, and predicates in queries and triple patterns. It combines matching logic with value extraction, allowing both specific matches and wildcard patterns.

Required Methods§

Source

fn value(&self) -> Option<&T>

Returns the underlying value if this matcher represents a specific value.

Returns None for wildcard matchers that match any value, and Some(value) for matchers that represent a specific RDF component.

Implementations on Foreign Types§

Source§

impl Matcher<NamedOrBlankNode> for NamedOrBlankNode

Implements the Matcher trait for OxSubject, enabling pattern matching.

Source§

fn value(&self) -> Option<&OxSubject>

Always returns Some(self) indicating a successful match.

Source§

impl Matcher<Term> for Term

Implements the Matcher trait for OxTerm, enabling pattern matching.

Source§

fn value(&self) -> Option<&OxTerm>

Always returns Some(self) indicating a successful match.

Source§

impl Matcher<NamedNode> for NamedNode

Implements the Matcher trait for OxNamedNode, enabling pattern matching.

This trivial implementation always matches by cloning the named node.

Source§

fn value(&self) -> Option<&OxNamedNode>

Always returns Some(self) indicating a successful match.

Implementors§

Source§

impl<T> Matcher<T> for Any