Query

Trait Query 

Source
pub trait Query: Sized {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn parse(query_source: &str) -> Result<Self, Self::Error>;
    fn parse_with(
        query_source: &str,
        base: Iri<&str>,
    ) -> Result<Self, Self::Error>;
}
Expand description

Preprocessed query, ready for execution.

This trait exist to allow some implementations of SparqlDataset to mutualize the parsing of queries in the prepare_query method.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error type that might be raised when parsing a query.

Required Methods§

Source

fn parse(query_source: &str) -> Result<Self, Self::Error>

Parse the given text into a Query.

Source

fn parse_with(query_source: &str, base: Iri<&str>) -> Result<Self, Self::Error>

Parse the given text into a Query, using the given base IRI

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Query for String

Source§

type Error = Infallible

Source§

fn parse(query_source: &str) -> Result<Self, Self::Error>

Source§

fn parse_with(query_source: &str, base: Iri<&str>) -> Result<Self, Self::Error>

Implementors§