[−][src]Struct qldb::DocumentCollection
Represents a collection of documents. It implements so you can call in order to use it in for loops or with .
It adds some utilities methods in order to do common operations.
You can use the into_iter in order to execute aggregate values or to make other complex operation.
use qldb::{DocumentCollection, QLDBExtractResult}; // Adds all the "points" attributes from each document. // It stops early in case of error extracting the attribute. fn count_points(matches: DocumentCollection) -> QLDBExtractResult<u64> { // You can use other types as BigUInt, BigDecimal, etc // in order to avoid overflow let result: u64 = matches .into_iter() .map(|doc| doc.get_value::<u64>("points")) .collect::<Result<Vec<u64>, _>>()? .into_iter() .fold(0, |acc, val| acc + val); Ok(result) }
Implementations
impl DocumentCollection
[src]
pub fn new(documents: Vec<Document>) -> DocumentCollection
[src]
pub fn into_inner(self) -> Vec<Document>
[src]
pub fn to_vec(self) -> Vec<Document>
[src]
pub fn len(self) -> usize
[src]
Trait Implementations
impl AsRef<Vec<Document, Global>> for DocumentCollection
[src]
impl Clone for DocumentCollection
[src]
pub fn clone(&self) -> DocumentCollection
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DocumentCollection
[src]
impl Default for DocumentCollection
[src]
impl Extend<Document> for DocumentCollection
[src]
pub fn extend<T: IntoIterator<Item = Document>>(&mut self, iter: T)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl Index<usize> for DocumentCollection
[src]
type Output = Document
The returned type after indexing.
pub fn index(&self, index: usize) -> &Self::Output
[src]
impl IntoIterator for DocumentCollection
[src]
type Item = Document
The type of the elements being iterated over.
type IntoIter = IntoIter<Self::Item>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<DocumentCollection> for DocumentCollection
[src]
pub fn eq(&self, other: &DocumentCollection) -> bool
[src]
pub fn ne(&self, other: &DocumentCollection) -> bool
[src]
impl StructuralPartialEq for DocumentCollection
[src]
impl TryFrom<Vec<IonValue, Global>> for DocumentCollection
[src]
Auto Trait Implementations
impl RefUnwindSafe for DocumentCollection
[src]
impl Send for DocumentCollection
[src]
impl Sync for DocumentCollection
[src]
impl Unpin for DocumentCollection
[src]
impl UnwindSafe for DocumentCollection
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,