pub struct ResultSet { /* private fields */ }Expand description
A query result: named columns and rows of values.
Beside the rows it may carry three things no renderer has to read: the
EntityKind of each bare-variable column, the Entity behind each of
their cells (only when asked for), and a write’s WriteStats. Equality
compares the columns and rows alone, the table every surface renders.
Implementations§
Source§impl ResultSet
impl ResultSet
pub fn new(columns: Vec<String>) -> Self
pub fn push_row(&mut self, row: Vec<Option<Value>>)
pub fn columns(&self) -> &[String]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, i: usize, col: &str) -> Option<&Value>
Sourcepub fn column_kind(&self, col: usize) -> Option<EntityKind>
pub fn column_kind(&self, col: usize) -> Option<EntityKind>
The kind of column col, when it is a bare graph variable.
Sourcepub fn column_kinds(&self) -> &[Option<EntityKind>]
pub fn column_kinds(&self) -> &[Option<EntityKind>]
The kind of every column, in column order.
Sourcepub fn set_column_kinds(&mut self, kinds: Vec<Option<EntityKind>>)
pub fn set_column_kinds(&mut self, kinds: Vec<Option<EntityKind>>)
Set the kind of every column. Extra entries are dropped and missing
ones are None, so the list always matches the columns.
Sourcepub fn entity(&self, row: usize, col: usize) -> Option<&Entity>
pub fn entity(&self, row: usize, col: usize) -> Option<&Entity>
The graph element behind cell (row, col), when entity details were
attached and the cell holds one.
Sourcepub fn has_entities(&self) -> bool
pub fn has_entities(&self) -> bool
Whether entity details are attached.
Sourcepub fn set_entities(&mut self, entities: Vec<Option<Entity>>)
pub fn set_entities(&mut self, entities: Vec<Option<Entity>>)
Attach the graph element behind each cell, row-major.
§Panics — if entities.len() is not len() * columns().len().
Sourcepub fn value_entity_tree(
&self,
row: usize,
col: usize,
) -> Option<&ValueEntityTree>
pub fn value_entity_tree( &self, row: usize, col: usize, ) -> Option<&ValueEntityTree>
The resolved entity tree for cell (row, col), when entity details
were attached for a column that holds a computed value with embedded
graph elements (a map, a mixed list, head(collect(n)), etc.).
Sourcepub fn stats(&self) -> Option<&WriteStats>
pub fn stats(&self) -> Option<&WriteStats>
What the write statement that produced this result changed.
Sourcepub fn with_stats(self, stats: WriteStats) -> Self
pub fn with_stats(self, stats: WriteStats) -> Self
Record what the write statement that produced this result changed.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ResultSet
impl Freeze for ResultSet
impl RefUnwindSafe for ResultSet
impl Send for ResultSet
impl Sync for ResultSet
impl Unpin for ResultSet
impl UnsafeUnpin for ResultSet
impl UnwindSafe for ResultSet
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.