Struct mentat_transaction::query::RelResult
[−]
[src]
pub struct RelResult<T> { pub width: usize, pub values: Vec<T>, }
The result you get from a 'rel' query, like:
[:find ?person ?name
:where [?person :person/name ?name]]
There are three ways to get data out of a RelResult
:
- By iterating over rows as slices. Use
result.rows()
. This is efficient and is recommended in two cases:- If you don't need to take ownership of the resulting values (e.g., you're comparing or making a modified clone).
- When the data you're retrieving is cheap to clone. All scalar values are relatively
cheap: they're either small values or
Rc
.
- By direct reference to a row by index, using
result.row(i)
. This also returns a reference. - By consuming the results using
into_iter
. This allocates short-lived vectors, but gives you ownership of the enclosedTypedValue
s.
Fields
width: usize
values: Vec<T>
Methods
impl<T> RelResult<T>
[src]
pub fn empty(width: usize) -> RelResult<T>
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn row_count(&self) -> usize
[src]
ⓘImportant traits for Chunks<'a, T>pub fn rows(&self) -> Chunks<T>
[src]
ⓘImportant traits for Chunks<'a, T>
pub fn row(&self, index: usize) -> Option<&[T]>
[src]
Trait Implementations
impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
[src]
impl<T> Debug for RelResult<T> where
T: Debug,
[src]
T: Debug,
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<T> Clone for RelResult<T> where
T: Clone,
[src]
T: Clone,
fn clone(&self) -> RelResult<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> IntoIterator for RelResult<T>
[src]
type Item = Vec<T>
The type of the elements being iterated over.
type IntoIter = SubvecIntoIterator<T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> <RelResult<T> as IntoIterator>::IntoIter
[src]
Creates an iterator from a value. Read more
impl<T> Eq for RelResult<T> where
T: Eq,
[src]
T: Eq,
impl<T> PartialEq<RelResult<T>> for RelResult<T> where
T: PartialEq<T>,
[src]
T: PartialEq<T>,