[−][src]Struct sophia::graph::inmem::HashGraph
A generic implementation of Graph
and MutableGraph
,
storing its terms in a TermIndexMap
,
and its triples in a HashSet
.
Implementations
impl<I> HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
[src]
I: TermIndexMap,
I::Index: Hash,
Trait Implementations
impl<I> CollectibleGraph for HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
fn from_triple_source<TS: TripleSource>(
triples: TS
) -> StreamResult<Self, TS::Error, Infallible>
[src]
triples: TS
) -> StreamResult<Self, TS::Error, Infallible>
impl<I: Default> Default for HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
I::Index: Default,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
I::Index: Default,
impl<I> Graph for HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
type Triple = ByTermRefs<Term<Self::TermData>>
Determine the type of Triple
s that the methods of this graph will yield (see streaming_mode
Read more
type Error = Infallible
The error type that this graph may raise.
fn triples(&self) -> GTripleSource<'_, Self>
[src]
fn triples_with_s<TS>(
&'s self,
s: &'s TS
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TS: TTerm + ?Sized,
[src]
&'s self,
s: &'s TS
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TS: TTerm + ?Sized,
fn triples_with_p<TP>(
&'s self,
p: &'s TP
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TP: TTerm + ?Sized,
[src]
&'s self,
p: &'s TP
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TP: TTerm + ?Sized,
fn triples_with_o<TO>(
&'s self,
o: &'s TO
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TO: TTerm + ?Sized,
[src]
&'s self,
o: &'s TO
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TO: TTerm + ?Sized,
fn triples_with_sp<TS, TP>(
&'s self,
s: &'s TS,
p: &'s TP
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TP: TTerm + ?Sized,
TS: TTerm + ?Sized,
[src]
&'s self,
s: &'s TS,
p: &'s TP
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TP: TTerm + ?Sized,
TS: TTerm + ?Sized,
fn triples_with_so<TS, TO>(
&'s self,
s: &'s TS,
o: &'s TO
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TO: TTerm + ?Sized,
TS: TTerm + ?Sized,
[src]
&'s self,
s: &'s TS,
o: &'s TO
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TO: TTerm + ?Sized,
TS: TTerm + ?Sized,
fn triples_with_po<TP, TO>(
&'s self,
p: &'s TP,
o: &'s TO
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TO: TTerm + ?Sized,
TP: TTerm + ?Sized,
[src]
&'s self,
p: &'s TP,
o: &'s TO
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TO: TTerm + ?Sized,
TP: TTerm + ?Sized,
fn triples_with_spo<TS, TP, TO>(
&'s self,
s: &'s TS,
p: &'s TP,
o: &'s TO
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TO: TTerm + ?Sized,
TP: TTerm + ?Sized,
TS: TTerm + ?Sized,
[src]
&'s self,
s: &'s TS,
p: &'s TP,
o: &'s TO
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
TO: TTerm + ?Sized,
TP: TTerm + ?Sized,
TS: TTerm + ?Sized,
fn contains<TS, TP, TO>(
&self,
s: &TS,
p: &TP,
o: &TO
) -> Result<bool, Self::Error> where
TO: TTerm + ?Sized,
TP: TTerm + ?Sized,
TS: TTerm + ?Sized,
[src]
&self,
s: &TS,
p: &TP,
o: &TO
) -> Result<bool, Self::Error> where
TO: TTerm + ?Sized,
TP: TTerm + ?Sized,
TS: TTerm + ?Sized,
fn triples_matching<S, P, O>(
&'s self,
ms: &'s S,
mp: &'s P,
mo: &'s O
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
O: TermMatcher + ?Sized,
P: TermMatcher + ?Sized,
S: TermMatcher + ?Sized,
[src]
&'s self,
ms: &'s S,
mp: &'s P,
mo: &'s O
) -> Box<dyn Iterator<Item = Result<StreamedTriple<'s, Self::Triple>, Self::Error>> + 's> where
O: TermMatcher + ?Sized,
P: TermMatcher + ?Sized,
S: TermMatcher + ?Sized,
fn subjects(
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
[src]
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
fn predicates(
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
[src]
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
fn objects(
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
[src]
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
fn iris(
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
[src]
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
fn bnodes(
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
[src]
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
fn literals(
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
[src]
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
fn variables(
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
[src]
&self
) -> Result<HashSet<<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term, RandomState>, Self::Error> where
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Eq,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Hash,
fn as_dataset(&self) -> GraphAsDataset<Self, &Self>
[src]
fn as_dataset_mut(&mut self) -> GraphAsDataset<Self, &mut Self>
[src]
fn into_dataset(self) -> GraphAsDataset<Self, Self>
[src]
impl<I> IndexedGraph for HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
type Index = I::Index
The type used to represent terms internally.
type TermData = <I::Factory as TermFactory>::TermData
fn with_capacity(capacity: usize) -> Self
[src]
fn shrink_to_fit(&mut self)
[src]
fn get_index<T: ?Sized>(&self, t: &T) -> Option<Self::Index> where
T: TTerm,
[src]
T: TTerm,
fn get_term(&self, i: Self::Index) -> Option<&Term<Self::TermData>>
[src]
fn insert_indexed<TS: ?Sized, TP: ?Sized, TO: ?Sized>(
&mut self,
s: &TS,
p: &TP,
o: &TO
) -> Option<[Self::Index; 3]> where
TS: TTerm,
TP: TTerm,
TO: TTerm,
[src]
&mut self,
s: &TS,
p: &TP,
o: &TO
) -> Option<[Self::Index; 3]> where
TS: TTerm,
TP: TTerm,
TO: TTerm,
fn remove_indexed<TS: ?Sized, TP: ?Sized, TO: ?Sized>(
&mut self,
s: &TS,
p: &TP,
o: &TO
) -> Option<[Self::Index; 3]> where
TS: TTerm,
TP: TTerm,
TO: TTerm,
[src]
&mut self,
s: &TS,
p: &TP,
o: &TO
) -> Option<[Self::Index; 3]> where
TS: TTerm,
TP: TTerm,
TO: TTerm,
impl<I> MutableGraph for HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
[src]
I: TermIndexMap,
I::Index: Hash,
<I::Factory as TermFactory>::TermData: 'static,
type MutationError = Infallible
The error type that this graph may raise during mutations.
fn insert<TS_: ?Sized, TP_: ?Sized, TO_: ?Sized>(
&mut self,
s: &TS_,
p: &TP_,
o: &TO_
) -> MGResult<Self, bool> where
TS_: TTerm,
TP_: TTerm,
TO_: TTerm,
[src]
&mut self,
s: &TS_,
p: &TP_,
o: &TO_
) -> MGResult<Self, bool> where
TS_: TTerm,
TP_: TTerm,
TO_: TTerm,
fn remove<TS_: ?Sized, TP_: ?Sized, TO_: ?Sized>(
&mut self,
s: &TS_,
p: &TP_,
o: &TO_
) -> MGResult<Self, bool> where
TS_: TTerm,
TP_: TTerm,
TO_: TTerm,
[src]
&mut self,
s: &TS_,
p: &TP_,
o: &TO_
) -> MGResult<Self, bool> where
TS_: TTerm,
TP_: TTerm,
TO_: TTerm,
fn insert_all<TS>(
&mut self,
src: TS
) -> Result<usize, StreamError<<TS as TripleSource>::Error, Self::MutationError>> where
TS: TripleSource,
[src]
&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,
[src]
&mut self,
src: TS
) -> Result<usize, StreamError<<TS as TripleSource>::Error, Self::MutationError>> where
TS: TripleSource,
fn remove_matching<S, P, O>(
&'s mut self,
ms: &S,
mp: &P,
mo: &O
) -> Result<usize, Self::MutationError> where
O: TermMatcher + ?Sized,
P: TermMatcher + ?Sized,
S: TermMatcher + ?Sized,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
Self::Error: Into<Self::MutationError>,
[src]
&'s mut self,
ms: &S,
mp: &P,
mo: &O
) -> Result<usize, Self::MutationError> where
O: TermMatcher + ?Sized,
P: TermMatcher + ?Sized,
S: TermMatcher + ?Sized,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
Self::Error: Into<Self::MutationError>,
fn retain_matching<S, P, O>(
&'s mut self,
ms: &S,
mp: &P,
mo: &O
) -> Result<(), Self::MutationError> where
O: TermMatcher + ?Sized,
P: TermMatcher + ?Sized,
S: TermMatcher + ?Sized,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
Self::Error: Into<Self::MutationError>,
[src]
&'s mut self,
ms: &S,
mp: &P,
mo: &O
) -> Result<(), Self::MutationError> where
O: TermMatcher + ?Sized,
P: TermMatcher + ?Sized,
S: TermMatcher + ?Sized,
<<Self::Triple as TripleStreamingMode>::UnsafeTriple as UnsafeTriple>::Term: Clone,
Self::Error: Into<Self::MutationError>,
impl<I> SetGraph for HashGraph<I> where
I: TermIndexMap,
I::Index: Hash,
[src]
I: TermIndexMap,
I::Index: Hash,
Auto Trait Implementations
impl<I> RefUnwindSafe for HashGraph<I> where
I: RefUnwindSafe,
<I as TermIndexMap>::Index: RefUnwindSafe,
I: RefUnwindSafe,
<I as TermIndexMap>::Index: RefUnwindSafe,
impl<I> Send for HashGraph<I> where
I: Send,
<I as TermIndexMap>::Index: Send,
I: Send,
<I as TermIndexMap>::Index: Send,
impl<I> Sync for HashGraph<I> where
I: Sync,
<I as TermIndexMap>::Index: Sync,
I: Sync,
<I as TermIndexMap>::Index: Sync,
impl<I> Unpin for HashGraph<I> where
I: Unpin,
<I as TermIndexMap>::Index: Unpin,
I: Unpin,
<I as TermIndexMap>::Index: Unpin,
impl<I> UnwindSafe for HashGraph<I> where
I: UnwindSafe,
<I as TermIndexMap>::Index: UnwindSafe,
I: UnwindSafe,
<I as TermIndexMap>::Index: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,