Struct mentat_ffi::RelResult
[−]
[src]
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]
impl<T> RelResult<T>
pub fn empty(width: usize) -> RelResult<T>
[src]
pub fn empty(width: usize) -> RelResult<T>
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
pub fn row_count(&self) -> usize
[src]
pub fn row_count(&self) -> usize
ⓘImportant traits for Chunks<'a, T>pub fn rows(&self) -> Chunks<T>
[src]
ⓘImportant traits for Chunks<'a, T>
pub fn rows(&self) -> Chunks<T>
pub fn row(&self, index: usize) -> Option<&[T]>
[src]
pub fn row(&self, index: usize) -> Option<&[T]>
Trait Implementations
impl<T> IntoIterator for RelResult<T>
[src]
impl<T> IntoIterator for RelResult<T>
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]
fn into_iter(self) -> <RelResult<T> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
impl<T> Clone for RelResult<T> where
T: Clone,
[src]
impl<T> Clone for RelResult<T> where
T: Clone,
fn clone(&self) -> RelResult<T>
[src]
fn clone(&self) -> RelResult<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
[src]
impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
impl<T> Eq for RelResult<T> where
T: Eq,
[src]
impl<T> Eq for RelResult<T> where
T: Eq,
impl<T> PartialEq<RelResult<T>> for RelResult<T> where
T: PartialEq<T>,
[src]
impl<T> PartialEq<RelResult<T>> for RelResult<T> where
T: PartialEq<T>,
fn eq(&self, __arg_0: &RelResult<T>) -> bool
[src]
fn eq(&self, __arg_0: &RelResult<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &RelResult<T>) -> bool
[src]
fn ne(&self, __arg_0: &RelResult<T>) -> bool
This method tests for !=
.
impl<T> Debug for RelResult<T> where
T: Debug,
[src]
impl<T> Debug for RelResult<T> where
T: Debug,