pub struct CompatGraph<D>(pub D);
Expand description
A graph type to wrap around few common rust types, providing graph implementations for them.
Tuple Fields§
§0: D
Trait Implementations§
Source§impl<D: Clone> Clone for CompatGraph<D>
impl<D: Clone> Clone for CompatGraph<D>
Source§fn clone(&self) -> CompatGraph<D>
fn clone(&self) -> CompatGraph<D>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Term + FromTerm + Clone> CollectibleGraph for CompatGraph<EcoVec<[T; 3]>>
impl<T: Term + FromTerm + Clone> CollectibleGraph for CompatGraph<EcoVec<[T; 3]>>
Source§fn from_triple_source<TS: TripleSource>(
triples: TS,
) -> StreamResult<Self, TS::Error, Self::Error>
fn from_triple_source<TS: TripleSource>( triples: TS, ) -> StreamResult<Self, TS::Error, Self::Error>
Construct a graph from the given source
Source§impl<D: Debug> Debug for CompatGraph<D>
impl<D: Debug> Debug for CompatGraph<D>
Source§impl<D: Default> Default for CompatGraph<D>
impl<D: Default> Default for CompatGraph<D>
Source§fn default() -> CompatGraph<D>
fn default() -> CompatGraph<D>
Returns the “default value” for a type. Read more
Source§impl<T> Deref for CompatGraph<T>
impl<T> Deref for CompatGraph<T>
Source§impl<T: Triple> Graph for CompatGraph<EcoVec<T>>
impl<T: Triple> Graph for CompatGraph<EcoVec<T>>
Source§type Triple<'x> = [<<T as Triple>::Term as Term>::BorrowTerm<'x>; 3]
where
Self: 'x
type Triple<'x> = [<<T as Triple>::Term as Term>::BorrowTerm<'x>; 3] where Self: 'x
Determine the type of
Triple
s
that the methods of this graph will yield.Source§type Error = Infallible
type Error = Infallible
The error type that this graph may raise.
Source§fn triples(&self) -> GTripleSource<'_, Self>
fn triples(&self) -> GTripleSource<'_, Self>
An iterator visiting all triples of this graph in arbitrary order. Read more
Source§fn triples_matching<'s, S, P, O>(
&'s self,
sm: S,
pm: P,
om: O,
) -> Box<dyn Iterator<Item = Result<Self::Triple<'s>, Self::Error>> + 's>
fn triples_matching<'s, S, P, O>( &'s self, sm: S, pm: P, om: O, ) -> Box<dyn Iterator<Item = Result<Self::Triple<'s>, Self::Error>> + 's>
An iterator visiting all triples matching the given subject, predicate and object.
See
crate::term::matcher
. Read moreSource§fn contains<TS, TP, TO>(&self, s: TS, p: TP, o: TO) -> Result<bool, Self::Error>
fn contains<TS, TP, TO>(&self, s: TS, p: TP, o: TO) -> Result<bool, Self::Error>
Return
true
if this graph contains the given triple.Source§fn subjects(
&self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
fn subjects( &self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
Build a fallible iterator of all the terms used as subject in this Graph. Read more
Source§fn predicates(
&self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
fn predicates( &self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
Build a fallible iterator of all the terms used as predicate in this Graph. Read more
Source§fn objects(
&self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
fn objects( &self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
Build a fallible iterator of all the terms used as object in this Graph. Read more
Source§fn iris(
&self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
fn iris( &self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
Build a fallible iterator of all the IRIs used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn blank_nodes(
&self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
fn blank_nodes( &self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
Build a fallible iterator of all the blank nodes used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn literals(
&self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
fn literals( &self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
Build a fallible iterator of all the literals used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn quoted_triples<'s>(
&'s self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 's>
fn quoted_triples<'s>( &'s self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'s> as Triple>::Term, Self::Error>> + 's>
Build a fallible iterator of all the quoted triples used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn variables(
&self,
) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
fn variables( &self, ) -> Box<dyn Iterator<Item = Result<<Self::Triple<'_> as Triple>::Term, Self::Error>> + '_>
Build a fallible iterator of all the variables used in this Graph
(including those used inside quoted triples, if any). Read more
Source§fn as_dataset(&self) -> GraphAsDataset<&Self>
fn as_dataset(&self) -> GraphAsDataset<&Self>
Dataset
adapter borrowing this graphSource§fn as_dataset_mut(&mut self) -> GraphAsDataset<&mut Self>
fn as_dataset_mut(&mut self) -> GraphAsDataset<&mut Self>
Dataset
adapter borrowing this graph mutablySource§fn into_dataset(self) -> GraphAsDataset<Self>where
Self: Sized,
fn into_dataset(self) -> GraphAsDataset<Self>where
Self: Sized,
Dataset
adapter taking ownership of this graphSource§impl<D: Hash> Hash for CompatGraph<D>
impl<D: Hash> Hash for CompatGraph<D>
Source§impl<T: Term + FromTerm + Clone> MutableGraph for CompatGraph<EcoVec<[T; 3]>>
impl<T: Term + FromTerm + Clone> MutableGraph for CompatGraph<EcoVec<[T; 3]>>
Source§type MutationError = Infallible
type MutationError = Infallible
The error type that this graph may raise during mutations.
Source§fn insert<TS, TP, TO>(
&mut self,
s: TS,
p: TP,
o: TO,
) -> Result<bool, <Self as MutableGraph>::MutationError>
fn insert<TS, TP, TO>( &mut self, s: TS, p: TP, o: TO, ) -> Result<bool, <Self as MutableGraph>::MutationError>
Insert in this graph a triple made of the the given terms. Read more
Source§fn remove<TS, TP, TO>(&mut self, s: TS, p: TP, o: TO) -> MgResult<Self, bool>
fn remove<TS, TP, TO>(&mut self, s: TS, p: TP, o: TO) -> MgResult<Self, bool>
Remove from this graph the triple made of the the given terms. Read more
Source§fn insert_triple<T>(&mut self, triple: T) -> Result<bool, Self::MutationError>where
T: Triple,
fn insert_triple<T>(&mut self, triple: T) -> Result<bool, Self::MutationError>where
T: Triple,
Insert in this graph the given triple. Read more
Source§fn remove_triple<T>(&mut self, triple: T) -> Result<bool, Self::MutationError>where
T: Triple,
fn remove_triple<T>(&mut self, triple: T) -> Result<bool, Self::MutationError>where
T: Triple,
Remoe from this graph the given triple. Read more
Source§fn insert_all<TS>(
&mut self,
src: TS,
) -> Result<usize, StreamError<<TS as TripleSource>::Error, Self::MutationError>>where
TS: TripleSource,
fn insert_all<TS>(
&mut self,
src: TS,
) -> Result<usize, StreamError<<TS as TripleSource>::Error, Self::MutationError>>where
TS: TripleSource,
Insert into this graph all triples from the given source. Read more
Source§fn remove_all<TS>(
&mut self,
src: TS,
) -> Result<usize, StreamError<<TS as TripleSource>::Error, Self::MutationError>>where
TS: TripleSource,
fn remove_all<TS>(
&mut self,
src: TS,
) -> Result<usize, StreamError<<TS as TripleSource>::Error, Self::MutationError>>where
TS: TripleSource,
Remove from this graph all triples from the given source. Read more
Source§fn remove_matching<S, P, O>(
&mut self,
ms: S,
mp: P,
mo: O,
) -> Result<usize, Self::MutationError>
fn remove_matching<S, P, O>( &mut self, ms: S, mp: P, mo: O, ) -> Result<usize, Self::MutationError>
Remove all triples matching the given matchers. Read more
Source§fn retain_matching<S, P, O>(
&mut self,
ms: S,
mp: P,
mo: O,
) -> Result<(), Self::MutationError>
fn retain_matching<S, P, O>( &mut self, ms: S, mp: P, mo: O, ) -> Result<(), Self::MutationError>
Keep only the triples matching the given matchers. Read more
Source§impl<D: PartialEq> PartialEq for CompatGraph<D>
impl<D: PartialEq> PartialEq for CompatGraph<D>
impl<D: Copy> Copy for CompatGraph<D>
impl<D: Eq> Eq for CompatGraph<D>
impl<D> StructuralPartialEq for CompatGraph<D>
Auto Trait Implementations§
impl<D> Freeze for CompatGraph<D>where
D: Freeze,
impl<D> RefUnwindSafe for CompatGraph<D>where
D: RefUnwindSafe,
impl<D> Send for CompatGraph<D>where
D: Send,
impl<D> Sync for CompatGraph<D>where
D: Sync,
impl<D> Unpin for CompatGraph<D>where
D: Unpin,
impl<D> UnwindSafe for CompatGraph<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<G> InfallibleGraph for G
impl<G> InfallibleGraph for G
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more