[][src]Trait sophia::term::matcher::GraphNameMatcher

pub trait GraphNameMatcher {
    type TermData: TermData;
    fn constant(&self) -> Option<Option<&Term<Self::TermData>>>;
fn matches<T>(&self, g: Option<&Term<T>>) -> bool
    where
        T: TermData
; }

Generic trait for matching graph names, i.e. optional terms.

Associated Types

Loading content...

Required methods

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

If this matcher matches only one graph name, return it, else None.

NB: a graph name is already an Option, None meaning the (unnamed) default graph. As a consequence, this methods returns an option of option :

  • None means that the matcher does not match a single graph name,
  • Some(None) means that the matcher matches only the default graph,
  • Some(Some(term)) means that the matcher matches a single proper graph name.

fn matches<T>(&self, g: Option<&Term<T>>) -> bool where
    T: TermData

Check whether this matcher matches g.

Loading content...

Implementations on Foreign Types

impl<'_, U> GraphNameMatcher for Option<&'_ Term<U>> where
    U: TermData
[src]

type TermData = U

impl<U> GraphNameMatcher for Option<Term<U>> where
    U: TermData
[src]

type TermData = U

impl<M> GraphNameMatcher for [M] where
    M: GraphNameMatcher
[src]

type TermData = M::TermData

impl<M> GraphNameMatcher for Vec<M> where
    M: GraphNameMatcher
[src]

This is somewhat redundant with [M], but it is useful with Dataset::union_graph, were a matcher must be moved rather than borrowed.

type TermData = M::TermData

Loading content...

Implementors

impl GraphNameMatcher for AnyTerm[src]

type TermData = &'static str

impl<F: Fn(Option<&Term<&str>>) -> bool> GraphNameMatcher for F[src]

type TermData = &'static str

impl<U> GraphNameMatcher for Term<U> where
    U: TermData
[src]

type TermData = U

Loading content...