Expand description

Streaming modes for triple iterators and triple streams.

What this is about

The Graph traits provides a number of methods for iterating over Triples, as for example the Graph::triples method. Since Triple is itself a trait, the actual type returned by such iterating methods needs to be specified for each Graph implementation. This is what this module is about.

In the future, the ideal solution

Ideally, the concrete type of Triples returned by iterating methods would be directly given by the Graph::Triple associated type.

Unfortunately, in the current version of Rust, this is not practical: in many implementations, iterating methods would return references to triples that are actually owned by the graph itself. But the associated type Graph::Triple can not be a reference type, because the lifetime of such references can not be specified once and for all.

The ideal solution to this problem would be Generic Associated Types (GAT), but until those are stabilized, we need another solution.

In the meantime, the workaround

The associated type Graph::Triple is not a type implementing the Triple trait, it is one of the possible TripleStreamingModes provided by this module (see below). Then iterating methods are restricted to returning a particular version of [StreamedTriple<'a>], satisfying the given streaming mode. The available streaming mode are:

In addition, the macro make_scoped_triple_streaming_mode allows to create a streaming mode for any lifetime-parameterized type implementing Triple (see its documentation for more details).

NB: actually, another mode exists, but is specifically designed for the dataset::adapter, should never be needed in other contexts.

Structs

See module documentation.

See module documentation.

See module documentation.

See module documentation.

Traits

A utility trait used internally by make_scoped_triple_streaming_mode. It should not be implemented manually.

See module documentation.