Skip to main content

Queryable

Trait Queryable 

Source
pub trait Queryable: Send + Sync {
    // Required methods
    fn execute(&self) -> Result<Vec<HashMap<String, String>>>;
    fn name(&self) -> &str;

    // Provided method
    fn source(&self) -> Option<&str> { ... }
}
Expand description

Trait for query execution

Abstracts the execution of queries and binding extraction. Implementors return bindings (variable name → value) for template rendering.

Required Methods§

Source

fn execute(&self) -> Result<Vec<HashMap<String, String>>>

Execute the query and return a vector of binding maps

Each map represents one result row from the query. Keys are query variable names (e.g., “className”, “fieldName”). Values are result strings (IRIs, literals, etc.).

Source

fn name(&self) -> &str

Query name for logging/auditing

Provided Methods§

Source

fn source(&self) -> Option<&str>

Optional: query source for debugging

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§