Struct mentat_query_projector::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
pub fn rows(&self) -> Chunks<T>
[src]
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: Clone> Clone for RelResult<T>
[src]
impl<T: Clone> Clone for RelResult<T>
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<T: Debug> Debug for RelResult<T>
[src]
impl<T: Debug> Debug for RelResult<T>
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: PartialEq> PartialEq for RelResult<T>
[src]
impl<T: PartialEq> PartialEq for RelResult<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: Eq> Eq for RelResult<T>
[src]
impl<T: Eq> Eq for RelResult<T>
impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
[src]
impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
fn from(src: Vec<Vec<TypedValue>>) -> Self
[src]
fn from(src: Vec<Vec<TypedValue>>) -> Self
Performs the conversion.
impl<T> IntoIterator for RelResult<T>
[src]
impl<T> IntoIterator for RelResult<T>