Struct stam::QueryResultItems
source · pub struct QueryResultItems<'store> { /* private fields */ }Expand description
Represents an entire result row, each result stems from a query
Implementations§
source§impl<'store> QueryResultItems<'store>
impl<'store> QueryResultItems<'store>
sourcepub fn iter(&self) -> impl Iterator<Item = &QueryResultItem<'store>>
pub fn iter(&self) -> impl Iterator<Item = &QueryResultItem<'store>>
Iterator over all results
pub fn len(&self) -> usize
sourcepub fn get(&self, index: usize) -> Option<&QueryResultItem<'store>>
pub fn get(&self, index: usize) -> Option<&QueryResultItem<'store>>
Returns a result by index number
pub fn pop_last(&mut self) -> Option<QueryResultItem<'store>>
sourcepub fn get_by_name_or_first(
&self,
names: &QueryNames,
var: Option<&str>
) -> Result<&QueryResultItem<'store>, StamError>
pub fn get_by_name_or_first( &self, names: &QueryNames, var: Option<&str> ) -> Result<&QueryResultItem<'store>, StamError>
Returns a result by variable name (if specified), or get the first result. Raises an error if there are no results.
sourcepub fn get_by_name_or_last(
&self,
names: &QueryNames,
var: Option<&str>
) -> Result<&QueryResultItem<'store>, StamError>
pub fn get_by_name_or_last( &self, names: &QueryNames, var: Option<&str> ) -> Result<&QueryResultItem<'store>, StamError>
Returns a result by variable name (if specified), or get the last result. Raises an error if there are no results.
sourcepub fn get_by_name(
&self,
names: &QueryNames,
var: &str
) -> Result<&QueryResultItem<'store>, StamError>
pub fn get_by_name( &self, names: &QueryNames, var: &str ) -> Result<&QueryResultItem<'store>, StamError>
Returns a result by variable name
Trait Implementations§
source§impl<'store> IntoIterator for QueryResultItems<'store>
impl<'store> IntoIterator for QueryResultItems<'store>
§type IntoIter = <SmallVec<[QueryResultItem<'store>; 4]> as IntoIterator>::IntoIter
type IntoIter = <SmallVec<[QueryResultItem<'store>; 4]> as IntoIterator>::IntoIter
Which kind of iterator are we turning this into?
§type Item = QueryResultItem<'store>
type Item = QueryResultItem<'store>
The type of the elements being iterated over.
Auto Trait Implementations§
impl<'store> Freeze for QueryResultItems<'store>
impl<'store> RefUnwindSafe for QueryResultItems<'store>
impl<'store> Send for QueryResultItems<'store>
impl<'store> Sync for QueryResultItems<'store>
impl<'store> Unpin for QueryResultItems<'store>
impl<'store> UnwindSafe for QueryResultItems<'store>
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
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more