pub trait GraphRead {
// Required methods
fn matching_quads<'a>(
&'a self,
subject: Option<NamedOrBlankNodeRef<'_>>,
predicate: Option<NamedNodeRef<'_>>,
object: Option<TermRef<'_>>,
graph: Option<GraphNameRef<'_>>,
) -> impl Iterator<Item = Result<Quad>> + use<'a, Self>;
fn named_graphs(
&self,
) -> impl Iterator<Item = Result<NamedOrBlankNode>> + '_;
fn contains_named_graph(&self, graph: &NamedOrBlankNode) -> Result<bool>;
}Expand description
A fallible stream of stored quads, with explicit graph matching.
None matches every graph; Some(DefaultGraph) matches only the default
graph. Implementations preserve stored RDF terms and graph contexts. This
interface neither constructs a graph union nor copies the base dataset.
Storage owners remain responsible for exact-term encoding: a reader cannot
recover lexical forms already normalized by its storage backend.
During a consistent read, identical patterns must yield the same first quad;
no lexical sorting is required. Borrowed views use this stable representative
to deduplicate graph contexts without retaining all previously visited triples.
Required Methods§
Sourcefn matching_quads<'a>(
&'a self,
subject: Option<NamedOrBlankNodeRef<'_>>,
predicate: Option<NamedNodeRef<'_>>,
object: Option<TermRef<'_>>,
graph: Option<GraphNameRef<'_>>,
) -> impl Iterator<Item = Result<Quad>> + use<'a, Self>
fn matching_quads<'a>( &'a self, subject: Option<NamedOrBlankNodeRef<'_>>, predicate: Option<NamedNodeRef<'_>>, object: Option<TermRef<'_>>, graph: Option<GraphNameRef<'_>>, ) -> impl Iterator<Item = Result<Quad>> + use<'a, Self>
Stream matching quads. Read failures must remain errors, never omissions. Retain the source borrow, not the caller’s temporary pattern references.
Sourcefn named_graphs(&self) -> impl Iterator<Item = Result<NamedOrBlankNode>> + '_
fn named_graphs(&self) -> impl Iterator<Item = Result<NamedOrBlankNode>> + '_
Stream each named graph exactly once, including empty backend graphs. Iteration must not materialize the set of graph names.
Sourcefn contains_named_graph(&self, graph: &NamedOrBlankNode) -> Result<bool>
fn contains_named_graph(&self, graph: &NamedOrBlankNode) -> Result<bool>
Test graph existence, including empty graphs in capable storage backends.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".