pub struct QuerySolutions<S: Rdf> { /* private fields */ }Expand description
Implementations§
Source§impl<S: Rdf> QuerySolutions<S>
impl<S: Rdf> QuerySolutions<S>
Sourcepub fn new(
solutions: Vec<QuerySolution<S>>,
prefixmap: PrefixMap,
) -> QuerySolutions<S>
pub fn new( solutions: Vec<QuerySolution<S>>, prefixmap: PrefixMap, ) -> QuerySolutions<S>
Creates a new query solutions collection with the given data.
§Arguments
solutions- Vector of query solution rowsprefixmap- Prefix map for IRI qualification in output
Sourcepub fn empty() -> QuerySolutions<S>
pub fn empty() -> QuerySolutions<S>
Creates an empty query solutions collection.
Returns a new instance with no solutions and an empty prefix map.
Sourcepub fn prefixmap(&self) -> &PrefixMap
pub fn prefixmap(&self) -> &PrefixMap
Returns a reference to the prefix map.
The prefix map contains namespace bindings used for qualifying IRIs when displaying or formatting results.
Sourcepub fn extend(
&mut self,
solutions: Vec<QuerySolution<S>>,
prefixmap: PrefixMap,
) -> Result<(), PrefixMapError>
pub fn extend( &mut self, solutions: Vec<QuerySolution<S>>, prefixmap: PrefixMap, ) -> Result<(), PrefixMapError>
Extends this collection with additional solutions and prefix mappings.
§Arguments
solutions- Additional solutions to appendprefixmap- Prefix map to merge (new prefixes or updated IRIs)
§Errors
Returns an error if the prefix maps have conflicting definitions for the same prefix (same prefix bound to different namespaces).
Sourcepub fn iter(&self) -> impl Iterator<Item = &QuerySolution<S>>
pub fn iter(&self) -> impl Iterator<Item = &QuerySolution<S>>
Returns an iterator over the query solutions.
Sourcepub fn write_table(&self, writer: &mut dyn Write) -> Result<(), RDFError>
pub fn write_table(&self, writer: &mut dyn Write) -> Result<(), RDFError>
Writes the query solutions as a formatted ASCII table.
Produces a human-readable table with modern rounded borders, row numbers, and qualified IRIs using the prefix map. The table includes:
- Row numbers in the first column (1-indexed)
- Variable names as column headers (with
?prefix) - Qualified IRIs using registered prefixes
- Blank nodes displayed as
_:identifier - Literals shown with their datatype/language tags
- RDF-star quoted triples in
<< s p o >>syntax - Empty cells for unbound variables
§Arguments
writer- Output destination (stdout, file, buffer, etc.)
Returns an error if:
- Writing to the output fails
- Term conversion fails when processing solutions
Trait Implementations§
Source§impl<S: Clone + Rdf> Clone for QuerySolutions<S>
impl<S: Clone + Rdf> Clone for QuerySolutions<S>
Source§fn clone(&self) -> QuerySolutions<S>
fn clone(&self) -> QuerySolutions<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<S: Rdf> Display for QuerySolutions<S>
impl<S: Rdf> Display for QuerySolutions<S>
Source§impl<S: Rdf> IntoIterator for QuerySolutions<S>
impl<S: Rdf> IntoIterator for QuerySolutions<S>
Source§type Item = QuerySolution<S>
type Item = QuerySolution<S>
The type of items yielded by the iterator.
Source§type IntoIter = IntoIter<QuerySolution<S>>
type IntoIter = IntoIter<QuerySolution<S>>
The iterator type for consuming iteration.
Auto Trait Implementations§
impl<S> Freeze for QuerySolutions<S>
impl<S> RefUnwindSafe for QuerySolutions<S>
impl<S> Send for QuerySolutions<S>
impl<S> Sync for QuerySolutions<S>
impl<S> Unpin for QuerySolutions<S>
impl<S> UnsafeUnpin for QuerySolutions<S>
impl<S> UnwindSafe for QuerySolutions<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.