Improves documentation for the `ServiceHandler` struct

pull/12/head
Tpt 5 years ago
parent e5043052b7
commit b178f5dc4c
  1. 13
      lib/src/sparql/mod.rs

@ -159,7 +159,14 @@ impl<S: StoreConnection> PreparedQuery for SimplePreparedQuery<S> {
} }
} }
/// 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 { 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>( fn handle<'a>(
&'a self, &'a self,
node: &NamedNode, node: &NamedNode,
@ -170,10 +177,10 @@ pub trait ServiceHandler {
struct EmptyServiceHandler {} struct EmptyServiceHandler {}
impl ServiceHandler for EmptyServiceHandler { impl ServiceHandler for EmptyServiceHandler {
fn handle<'a>( fn handle(
&'a self, &self,
_node: &NamedNode, _node: &NamedNode,
) -> Option<(fn(GraphPattern) -> Result<BindingsIterator<'a>>)> { ) -> Option<(fn(GraphPattern) -> Result<BindingsIterator<'static>>)> {
None None
} }
} }

Loading…
Cancel
Save