Struct grdf::btree_dataset::BTreeGraph
source · [−]pub struct BTreeGraph<S = Term, P = S, O = S> { /* private fields */ }
Expand description
Graph implementation based on BTreeMap
and BTreeSet
.
Implementations
sourceimpl<S, P, O> BTreeGraph<S, P, O>
impl<S, P, O> BTreeGraph<S, P, O>
sourceimpl<S: Ord, P: Ord, O: Ord> BTreeGraph<S, P, O>
impl<S: Ord, P: Ord, O: Ord> BTreeGraph<S, P, O>
sourcepub fn from_graph<G: SizedGraph<Subject = S, Predicate = P, Object = O>>(
g: G
) -> BTreeGraph<S, P, O>
pub fn from_graph<G: SizedGraph<Subject = S, Predicate = P, Object = O>>(
g: G
) -> BTreeGraph<S, P, O>
Create a new BTreeGraph
from another graph by consuming its triples.
pub fn insert(&mut self, triple: Triple<S, P, O>)
pub fn absorb<G: SizedGraph<Subject = S, Predicate = P, Object = O>>(
&mut self,
other: G
)
sourceimpl<S, P, O> BTreeGraph<S, P, O>
impl<S, P, O> BTreeGraph<S, P, O>
pub fn triples(&self) -> Iter<'_, S, P, O>ⓘNotable traits for Iter<'a, S, P, O>impl<'a, S, P, O> Iterator for Iter<'a, S, P, O> type Item = Triple<&'a S, &'a P, &'a O>;
pub fn subjects(&self) -> Subjects<'_, S, P, O>ⓘNotable traits for Subjects<'a, S, P, O>impl<'a, S, P, O> Iterator for Subjects<'a, S, P, O> type Item = (&'a S, Predicates<'a, P, O>);
pub fn predicates(&self, subject: &S) -> Predicates<'_, P, O>ⓘNotable traits for Predicates<'a, P, O>impl<'a, P, O> Iterator for Predicates<'a, P, O> type Item = (&'a P, Objects<'a, O>);
where
S: Ord,
pub fn objects(&self, subject: &S, predicate: &P) -> Objects<'_, O>ⓘNotable traits for Objects<'a, O>impl<'a, O> Iterator for Objects<'a, O> type Item = &'a O;
where
S: Ord,
P: Ord,
pub fn contains(&self, Triple: Triple<&S, &P, &O>) -> bool where
S: Ord,
P: Ord,
O: Ord,
pub fn into_triples(self) -> IntoIter<S, P, O>ⓘNotable traits for IntoIter<S, P, O>impl<S: Clone, P: Clone, O> Iterator for IntoIter<S, P, O> type Item = Triple<S, P, O>;
pub fn into_subjects(self) -> IntoSubjects<S, P, O>ⓘNotable traits for IntoSubjects<S, P, O>impl<S, P, O> Iterator for IntoSubjects<S, P, O> type Item = (S, IntoPredicates<P, O>);
pub fn into_predicates(self, subject: &S) -> IntoPredicates<P, O>ⓘNotable traits for IntoPredicates<P, O>impl<P, O> Iterator for IntoPredicates<P, O> type Item = (P, IntoObjects<O>);
where
S: Ord,
pub fn into_objects(self, subject: &S, predicate: &P) -> IntoObjects<O>ⓘNotable traits for IntoObjects<O>impl<O> Iterator for IntoObjects<O> type Item = O;
where
S: Ord,
P: Ord,
Trait Implementations
sourceimpl<S, P, O> Default for BTreeGraph<S, P, O>
impl<S, P, O> Default for BTreeGraph<S, P, O>
sourceimpl<S: Ord, P: Ord, O: Ord> Extend<Triple<S, P, O>> for BTreeGraph<S, P, O>
impl<S: Ord, P: Ord, O: Ord> Extend<Triple<S, P, O>> for BTreeGraph<S, P, O>
sourcefn extend<I: IntoIterator<Item = Triple<S, P, O>>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Triple<S, P, O>>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<S: Ord, P: Ord, O: Ord> FromIterator<Triple<S, P, O>> for BTreeGraph<S, P, O>
impl<S: Ord, P: Ord, O: Ord> FromIterator<Triple<S, P, O>> for BTreeGraph<S, P, O>
sourcefn from_iter<I: IntoIterator<Item = Triple<S, P, O>>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = Triple<S, P, O>>>(iter: I) -> Self
Creates a value from an iterator. Read more
sourceimpl<S: Ord, P: Ord, O: Ord> Graph for BTreeGraph<S, P, O>
impl<S: Ord, P: Ord, O: Ord> Graph for BTreeGraph<S, P, O>
type Subject = S
type Predicate = P
type Object = O
type Predicates<'a>
where
Self: 'a,
P: 'a,
O: 'a = Predicates<'a, P, O>
type Predicates<'a>
where
Self: 'a,
P: 'a,
O: 'a = Predicates<'a, P, O>
Subject predicates iterator. Read more
type Subjects<'a>
where
Self: 'a,
S: 'a,
P: 'a,
O: 'a = Subjects<'a, S, P, O>
type Subjects<'a>
where
Self: 'a,
S: 'a,
P: 'a,
O: 'a = Subjects<'a, S, P, O>
Graph subjects iterator. Read more
fn triples<'a>(&'a self) -> Iter<'a, S, P, O>ⓘNotable traits for Iter<'a, S, P, O>impl<'a, S, P, O> Iterator for Iter<'a, S, P, O> type Item = Triple<&'a S, &'a P, &'a O>;
where
S: 'a,
P: 'a,
O: 'a,
sourcefn subjects<'a>(&'a self) -> Subjects<'a, S, P, O>ⓘNotable traits for Subjects<'a, S, P, O>impl<'a, S, P, O> Iterator for Subjects<'a, S, P, O> type Item = (&'a S, Predicates<'a, P, O>);
where
S: 'a,
P: 'a,
O: 'a,
fn subjects<'a>(&'a self) -> Subjects<'a, S, P, O>ⓘNotable traits for Subjects<'a, S, P, O>impl<'a, S, P, O> Iterator for Subjects<'a, S, P, O> type Item = (&'a S, Predicates<'a, P, O>);
where
S: 'a,
P: 'a,
O: 'a,
Iterate through all the subjects of the graph.
sourcefn predicates<'a>(&'a self, subject: &S) -> Predicates<'a, P, O>ⓘNotable traits for Predicates<'a, P, O>impl<'a, P, O> Iterator for Predicates<'a, P, O> type Item = (&'a P, Objects<'a, O>);
where
P: 'a,
O: 'a,
fn predicates<'a>(&'a self, subject: &S) -> Predicates<'a, P, O>ⓘNotable traits for Predicates<'a, P, O>impl<'a, P, O> Iterator for Predicates<'a, P, O> type Item = (&'a P, Objects<'a, O>);
where
P: 'a,
O: 'a,
Iterate through all the predicates associated to the given subject.
sourceimpl<'a, S, P, O> IntoIterator for &'a BTreeGraph<S, P, O>
impl<'a, S, P, O> IntoIterator for &'a BTreeGraph<S, P, O>
sourceimpl<S: Clone + Ord, P: Clone + Ord, O: Ord> IntoIterator for BTreeGraph<S, P, O>
impl<S: Clone + Ord, P: Clone + Ord, O: Ord> IntoIterator for BTreeGraph<S, P, O>
sourceimpl<S: Ord, P: Ord, O: Ord> MutableGraph for BTreeGraph<S, P, O>
impl<S: Ord, P: Ord, O: Ord> MutableGraph for BTreeGraph<S, P, O>
sourceimpl<S, P, O> Ord for BTreeGraph<S, P, O> where
S: Ord,
P: Ord,
O: Ord,
impl<S, P, O> Ord for BTreeGraph<S, P, O> where
S: Ord,
P: Ord,
O: Ord,
sourceimpl<S, P, O> PartialEq<BTreeGraph<S, P, O>> for BTreeGraph<S, P, O> where
S: Ord,
P: Ord,
O: Ord,
impl<S, P, O> PartialEq<BTreeGraph<S, P, O>> for BTreeGraph<S, P, O> where
S: Ord,
P: Ord,
O: Ord,
sourceimpl<S, P, O> PartialOrd<BTreeGraph<S, P, O>> for BTreeGraph<S, P, O> where
S: Ord,
P: Ord,
O: Ord,
impl<S, P, O> PartialOrd<BTreeGraph<S, P, O>> for BTreeGraph<S, P, O> where
S: Ord,
P: Ord,
O: Ord,
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Clone + Ord, P: Clone + Ord, O: Ord> SizedGraph for BTreeGraph<S, P, O>
impl<S: Clone + Ord, P: Clone + Ord, O: Ord> SizedGraph for BTreeGraph<S, P, O>
type IntoObjects = IntoObjects<O>
type IntoObjects = IntoObjects<O>
Consuming objects iterator.
type IntoPredicates = IntoPredicates<P, O>
type IntoPredicates = IntoPredicates<P, O>
Consuming predicates iterator.
type IntoSubjects = IntoSubjects<S, P, O>
type IntoSubjects = IntoSubjects<S, P, O>
Consuming subjects iterator.
type IntoTriples = IntoIter<S, P, O>
type IntoTriples = IntoIter<S, P, O>
Consuming triples iterator.
sourcefn into_triples(self) -> IntoIter<S, P, O>ⓘNotable traits for IntoIter<S, P, O>impl<S: Clone, P: Clone, O> Iterator for IntoIter<S, P, O> type Item = Triple<S, P, O>;
fn into_triples(self) -> IntoIter<S, P, O>ⓘNotable traits for IntoIter<S, P, O>impl<S: Clone, P: Clone, O> Iterator for IntoIter<S, P, O> type Item = Triple<S, P, O>;
Consumes the graph and returns an iterator over its triples.
sourcefn into_subjects(self) -> IntoSubjects<S, P, O>ⓘNotable traits for IntoSubjects<S, P, O>impl<S, P, O> Iterator for IntoSubjects<S, P, O> type Item = (S, IntoPredicates<P, O>);
fn into_subjects(self) -> IntoSubjects<S, P, O>ⓘNotable traits for IntoSubjects<S, P, O>impl<S, P, O> Iterator for IntoSubjects<S, P, O> type Item = (S, IntoPredicates<P, O>);
Consumes the graph and returns an iterator over its subjects.
sourcefn into_predicates(self, subject: &S) -> IntoPredicates<P, O>ⓘNotable traits for IntoPredicates<P, O>impl<P, O> Iterator for IntoPredicates<P, O> type Item = (P, IntoObjects<O>);
fn into_predicates(self, subject: &S) -> IntoPredicates<P, O>ⓘNotable traits for IntoPredicates<P, O>impl<P, O> Iterator for IntoPredicates<P, O> type Item = (P, IntoObjects<O>);
Consumes the graph and returns an iterator over the predicates of the given subject. Read more
sourcefn into_objects(self, subject: &S, predicate: &P) -> IntoObjects<O>ⓘNotable traits for IntoObjects<O>impl<O> Iterator for IntoObjects<O> type Item = O;
fn into_objects(self, subject: &S, predicate: &P) -> IntoObjects<O>ⓘNotable traits for IntoObjects<O>impl<O> Iterator for IntoObjects<O> type Item = O;
Consumes the graph and returns an iterator over the objects of the given subject and predicate. Read more
impl<S, P, O> Eq for BTreeGraph<S, P, O> where
S: Ord,
P: Ord,
O: Ord,
Auto Trait Implementations
impl<S, P, O> RefUnwindSafe for BTreeGraph<S, P, O> where
O: RefUnwindSafe,
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, P, O> Send for BTreeGraph<S, P, O> where
O: Send,
P: Send,
S: Send,
impl<S, P, O> Sync for BTreeGraph<S, P, O> where
O: Sync,
P: Sync,
S: Sync,
impl<S, P, O> Unpin for BTreeGraph<S, P, O>
impl<S, P, O> UnwindSafe for BTreeGraph<S, P, O> where
O: RefUnwindSafe,
P: RefUnwindSafe,
S: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more