Struct CompatGraph

Source
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>

Source§

fn clone(&self) -> CompatGraph<D>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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>

Construct a graph from the given source
Source§

impl<D: Debug> Debug for CompatGraph<D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D: Default> Default for CompatGraph<D>

Source§

fn default() -> CompatGraph<D>

Returns the “default value” for a type. Read more
Source§

impl<T> Deref for CompatGraph<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: Triple> Graph for CompatGraph<EcoVec<T>>

Source§

type Triple<'x> = [<<T as Triple>::Term as Term>::BorrowTerm<'x>; 3] where Self: 'x

Determine the type of Triples that the methods of this graph will yield.
Source§

type Error = Infallible

The error type that this graph may raise.
Source§

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>
where S: TermMatcher + 's, P: TermMatcher + 's, O: TermMatcher + 's,

An iterator visiting all triples matching the given subject, predicate and object. See crate::term::matcher. Read more
Source§

fn contains<TS, TP, TO>(&self, s: TS, p: TP, o: TO) -> Result<bool, Self::Error>
where TS: Term, TP: Term, TO: Term,

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>> + '_>

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>> + '_>

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>> + '_>

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>> + '_>

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>> + '_>

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>> + '_>

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>
where <Self::Triple<'s> as Triple>::Term: Clone,

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>> + '_>

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>

Dataset adapter borrowing this graph
Source§

fn as_dataset_mut(&mut self) -> GraphAsDataset<&mut Self>

Dataset adapter borrowing this graph mutably
Source§

fn into_dataset(self) -> GraphAsDataset<Self>
where Self: Sized,

Dataset adapter taking ownership of this graph
Source§

impl<D: Hash> Hash for CompatGraph<D>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: Term + FromTerm + Clone> MutableGraph for CompatGraph<EcoVec<[T; 3]>>

Source§

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>
where TS: Term, TP: Term, TO: Term,

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>
where TS: Term, TP: Term, TO: Term,

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,

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,

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,

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,

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>
where S: TermMatcher, P: TermMatcher, O: TermMatcher, Self::MutationError: From<Self::Error>,

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>
where S: TermMatcher, P: TermMatcher, O: TermMatcher, Self::MutationError: From<Self::Error>,

Keep only the triples matching the given matchers. Read more
Source§

impl<D: PartialEq> PartialEq for CompatGraph<D>

Source§

fn eq(&self, other: &CompatGraph<D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D: Copy> Copy for CompatGraph<D>

Source§

impl<D: Eq> Eq for CompatGraph<D>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<G> InfallibleGraph for G
where G: Graph<Error = Infallible> + Debug,

Source§

fn var_set<T: FromTerm + PartialEq + Eq + Hash>(&self) -> HashSet<T>

Get set of all variables in this graph.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G> InfallibleMutableGraph for G
where G: MutableGraph<Error = Infallible, MutationError = Infallible> + Debug,