[][src]Trait sophia::graph::inmem::GraphWrapper

pub trait GraphWrapper {
    type Wrapped: Graph;
    fn get_wrapped(&self) -> &Self::Wrapped;
fn get_wrapped_mut(&mut self) -> &mut Self::Wrapped; fn gw_triples(&self) -> GTripleSource<'_, Self::Wrapped> { ... }
fn gw_triples_with_s<'s, TS: ?Sized>(
        &'s self,
        s: &'s TS
    ) -> GTripleSource<'s, Self::Wrapped>
    where
        TS: TTerm
, { ... }
fn gw_triples_with_p<'s, TP: ?Sized>(
        &'s self,
        p: &'s TP
    ) -> GTripleSource<'s, Self::Wrapped>
    where
        TP: TTerm
, { ... }
fn gw_triples_with_o<'s, TO: ?Sized>(
        &'s self,
        o: &'s TO
    ) -> GTripleSource<'s, Self::Wrapped>
    where
        TO: TTerm
, { ... }
fn gw_triples_with_sp<'s, TS: ?Sized, TP: ?Sized>(
        &'s self,
        s: &'s TS,
        p: &'s TP
    ) -> GTripleSource<'s, Self::Wrapped>
    where
        TS: TTerm,
        TP: TTerm
, { ... }
fn gw_triples_with_so<'s, TS: ?Sized, TO: ?Sized>(
        &'s self,
        s: &'s TS,
        o: &'s TO
    ) -> GTripleSource<'s, Self::Wrapped>
    where
        TS: TTerm,
        TO: TTerm
, { ... }
fn gw_triples_with_po<'s, TP: ?Sized, TO: ?Sized>(
        &'s self,
        p: &'s TP,
        o: &'s TO
    ) -> GTripleSource<'s, Self::Wrapped>
    where
        TP: TTerm,
        TO: TTerm
, { ... }
fn gw_triples_with_spo<'s, TS: ?Sized, TP: ?Sized, TO: ?Sized>(
        &'s self,
        s: &'s TS,
        p: &'s TP,
        o: &'s TO
    ) -> GTripleSource<'s, Self::Wrapped>
    where
        TS: TTerm,
        TP: TTerm,
        TO: TTerm
, { ... }
fn gw_contains<TS: ?Sized, TP: ?Sized, TO: ?Sized>(
        &self,
        s: &TS,
        p: &TP,
        o: &TO
    ) -> GResult<Self::Wrapped, bool>
    where
        TS: TTerm,
        TP: TTerm,
        TO: TTerm
, { ... }
fn gw_subjects(&self) -> GResultTermSet<Self::Wrapped>
    where
        GTerm<Self::Wrapped>: Clone + Eq + Hash
, { ... }
fn gw_predicates(&self) -> GResultTermSet<Self::Wrapped>
    where
        GTerm<Self::Wrapped>: Clone + Eq + Hash
, { ... }
fn gw_objects(&self) -> GResultTermSet<Self::Wrapped>
    where
        GTerm<Self::Wrapped>: Clone + Eq + Hash
, { ... }
fn gw_iris(&self) -> GResultTermSet<Self::Wrapped>
    where
        GTerm<Self::Wrapped>: Clone + Eq + Hash
, { ... }
fn gw_bnodes(&self) -> GResultTermSet<Self::Wrapped>
    where
        GTerm<Self::Wrapped>: Clone + Eq + Hash
, { ... }
fn gw_literals(&self) -> GResultTermSet<Self::Wrapped>
    where
        GTerm<Self::Wrapped>: Clone + Eq + Hash
, { ... }
fn gw_variables(&self) -> GResultTermSet<Self::Wrapped>
    where
        GTerm<Self::Wrapped>: Clone + Eq + Hash
, { ... } }

A graph wrapper wraps a Graph and overrides some of its methods.

This trait mimmics the interface of the Graph trait, with all methods having a default implementation that delegates to the corresponding method of the wrapped graph. Implementation of this trait may however expected to override some of the methods.

Conversely, the impl_graph_for_wrapper! macro can be used to derive the Graph implementation for any implementation of GraphWrapper.

Associated Types

type Wrapped: Graph

The type of the wrapped graph.

Loading content...

Required methods

fn get_wrapped(&self) -> &Self::Wrapped

Borrow the wrapped graph.

fn get_wrapped_mut(&mut self) -> &mut Self::Wrapped

Borrow the wrapped graph mutably.

Loading content...

Provided methods

fn gw_triples(&self) -> GTripleSource<'_, Self::Wrapped>

Mimmic the iter method.

fn gw_triples_with_s<'s, TS: ?Sized>(
    &'s self,
    s: &'s TS
) -> GTripleSource<'s, Self::Wrapped> where
    TS: TTerm

Mimmic the triples_with_s method.

fn gw_triples_with_p<'s, TP: ?Sized>(
    &'s self,
    p: &'s TP
) -> GTripleSource<'s, Self::Wrapped> where
    TP: TTerm

Mimmic the triples_with_p method.

fn gw_triples_with_o<'s, TO: ?Sized>(
    &'s self,
    o: &'s TO
) -> GTripleSource<'s, Self::Wrapped> where
    TO: TTerm

Mimmic the triples_with_o method.

fn gw_triples_with_sp<'s, TS: ?Sized, TP: ?Sized>(
    &'s self,
    s: &'s TS,
    p: &'s TP
) -> GTripleSource<'s, Self::Wrapped> where
    TS: TTerm,
    TP: TTerm

Mimmic the triples_with_sp method.

fn gw_triples_with_so<'s, TS: ?Sized, TO: ?Sized>(
    &'s self,
    s: &'s TS,
    o: &'s TO
) -> GTripleSource<'s, Self::Wrapped> where
    TS: TTerm,
    TO: TTerm

Mimmic the triples_with_so method.

fn gw_triples_with_po<'s, TP: ?Sized, TO: ?Sized>(
    &'s self,
    p: &'s TP,
    o: &'s TO
) -> GTripleSource<'s, Self::Wrapped> where
    TP: TTerm,
    TO: TTerm

Mimmic the triples_with_po method.

fn gw_triples_with_spo<'s, TS: ?Sized, TP: ?Sized, TO: ?Sized>(
    &'s self,
    s: &'s TS,
    p: &'s TP,
    o: &'s TO
) -> GTripleSource<'s, Self::Wrapped> where
    TS: TTerm,
    TP: TTerm,
    TO: TTerm

Mimmic the triples_with_spo method.

fn gw_contains<TS: ?Sized, TP: ?Sized, TO: ?Sized>(
    &self,
    s: &TS,
    p: &TP,
    o: &TO
) -> GResult<Self::Wrapped, bool> where
    TS: TTerm,
    TP: TTerm,
    TO: TTerm

Mimmic the contains method.

fn gw_subjects(&self) -> GResultTermSet<Self::Wrapped> where
    GTerm<Self::Wrapped>: Clone + Eq + Hash

Mimmic the subjects method.

fn gw_predicates(&self) -> GResultTermSet<Self::Wrapped> where
    GTerm<Self::Wrapped>: Clone + Eq + Hash

Mimmic the predicates method.

fn gw_objects(&self) -> GResultTermSet<Self::Wrapped> where
    GTerm<Self::Wrapped>: Clone + Eq + Hash

Mimmic the objects method.

fn gw_iris(&self) -> GResultTermSet<Self::Wrapped> where
    GTerm<Self::Wrapped>: Clone + Eq + Hash

Mimmic the iris method.

fn gw_bnodes(&self) -> GResultTermSet<Self::Wrapped> where
    GTerm<Self::Wrapped>: Clone + Eq + Hash

Mimmic the bnodes method.

fn gw_literals(&self) -> GResultTermSet<Self::Wrapped> where
    GTerm<Self::Wrapped>: Clone + Eq + Hash

Mimmic the literals method.

fn gw_variables(&self) -> GResultTermSet<Self::Wrapped> where
    GTerm<Self::Wrapped>: Clone + Eq + Hash

Mimmic the variables method.

Loading content...

Implementors

impl<T> GraphWrapper for OpsWrapper<T> where
    T: IndexedGraph + Graph<Triple = ByTermRefs<Term<<T as IndexedGraph>::TermData>>>, 
[src]

type Wrapped = T

impl<T> GraphWrapper for SpoWrapper<T> where
    T: IndexedGraph + Graph<Triple = ByTermRefs<Term<<T as IndexedGraph>::TermData>>>, 
[src]

type Wrapped = T

Loading content...