From b178f5dc4cb29efaa0c23c976cea51e3cc9bd034 Mon Sep 17 00:00:00 2001 From: Tpt Date: Thu, 17 Oct 2019 13:05:52 +0200 Subject: [PATCH] Improves documentation for the `ServiceHandler` struct --- lib/src/sparql/mod.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/src/sparql/mod.rs b/lib/src/sparql/mod.rs index 3023f7cd..f0c62666 100644 --- a/lib/src/sparql/mod.rs +++ b/lib/src/sparql/mod.rs @@ -159,7 +159,14 @@ impl PreparedQuery for SimplePreparedQuery { } } +/// Handler for SPARQL SERVICEs. +/// +/// Might be used to implement [SPARQL 1.1 Federated Query](https://www.w3.org/TR/sparql11-federated-query/) pub trait ServiceHandler { + /// Get the handler for a given service identified by a RDF IRI. + /// + /// A service is a function that returns an iterator of bindings from a `GraphPattern`. + /// Returns `None` if there is no handler for the service. fn handle<'a>( &'a self, node: &NamedNode, @@ -170,10 +177,10 @@ pub trait ServiceHandler { struct EmptyServiceHandler {} impl ServiceHandler for EmptyServiceHandler { - fn handle<'a>( - &'a self, + fn handle( + &self, _node: &NamedNode, - ) -> Option<(fn(GraphPattern) -> Result>)> { + ) -> Option<(fn(GraphPattern) -> Result>)> { None } }