simple_triplestore/traits/
into_iter.rs

1use crate::{
2    prelude::*,
3    traits::{IdType, Property},
4    EdgeOrder, PropsTriple, Triple,
5};
6
7pub trait TripleStoreIntoIter<Id: IdType, NodeProps: Property, EdgeProps: Property>:
8    TripleStoreError
9{
10    // Return two iterators: one for vertices, and one for edges.
11    fn into_iter_nodes(
12        self,
13        order: EdgeOrder,
14    ) -> (
15        impl Iterator<Item = Result<(Id, NodeProps), Self::Error>>,
16        impl Iterator<Item = Result<(Triple<Id>, EdgeProps), Self::Error>>,
17    );
18
19    /// Iterate over vertices in the triplestore.
20    fn into_iter_vertices(self) -> impl Iterator<Item = Result<(Id, NodeProps), Self::Error>>;
21
22    /// Iterate over the edges in the triplestore, fetching node properties for each subject and object.
23    fn into_iter_edges_with_props(
24        self,
25        order: EdgeOrder,
26    ) -> impl Iterator<Item = Result<PropsTriple<Id, NodeProps, EdgeProps>, Self::Error>>;
27
28    /// Iterate over the edges in the triplestore
29    fn into_iter_edges(
30        self,
31        order: EdgeOrder,
32    ) -> impl Iterator<Item = Result<(Triple<Id>, EdgeProps), Self::Error>>;
33}