pub trait GraphNameMatcher {
    type Term: Term + ?Sized;

    // Required method
    fn matches<T2: Term + ?Sized>(&self, graph_name: GraphName<&T2>) -> bool;

    // Provided methods
    fn constant(&self) -> Option<GraphName<&Self::Term>> { ... }
    fn matcher_ref(&self) -> MatcherRef<'_, Self> { ... }
}
Expand description

Generic trait for matching GraphNames.

Required Associated Types§

source

type Term: Term + ?Sized

The type of term that this GraphNameMatcher contains

Required Methods§

source

fn matches<T2: Term + ?Sized>(&self, graph_name: GraphName<&T2>) -> bool

Check whether this matcher matches t.

Provided Methods§

source

fn constant(&self) -> Option<GraphName<&Self::Term>>

Return None, unless this matcher can only match a single graph name, in which case this method may return that graph name.

This method is provided for optimization purposes, so implementing it is optional.

source

fn matcher_ref(&self) -> MatcherRef<'_, Self>

Return a GraphNameMatcher that is actually just a reference to this one.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl GraphNameMatcher for Option<TermKind>

§

type Term = SimpleTerm<'static>

source§

fn matches<T2: Term + ?Sized>(&self, graph_name: GraphName<&T2>) -> bool

source§

impl<S, P, O> GraphNameMatcher for Option<(S, P, O)>

Matches only embedded triple whose components match the corresponding matchers.

§

type Term = <S as TermMatcher>::Term

source§

fn matches<T2: Term + ?Sized>(&self, graph_name: Option<&T2>) -> bool

source§

impl<T> GraphNameMatcher for &[GraphName<T>]
where T: Term,

§

type Term = T

source§

fn matches<T2: Term + ?Sized>(&self, graph_name: GraphName<&T2>) -> bool

source§

fn constant(&self) -> Option<GraphName<&Self::Term>>

source§

impl<T> GraphNameMatcher for Option<Option<T>>
where T: Term,

§

type Term = T

source§

fn matches<T2: Term + ?Sized>(&self, graph_name: GraphName<&T2>) -> bool

source§

fn constant(&self) -> Option<GraphName<&Self::Term>>

source§

impl<T, const N: usize> GraphNameMatcher for [GraphName<T>; N]
where T: Term,

§

type Term = T

source§

fn matches<T2: Term + ?Sized>(&self, graph_name: GraphName<&T2>) -> bool

source§

fn constant(&self) -> Option<GraphName<&Self::Term>>

Implementors§