Struct couch_rs::document::DocumentCollection
source · pub struct DocumentCollection<T: TypedCouchDocument> {
pub offset: Option<u32>,
pub rows: Vec<T>,
pub total_rows: u32,
pub bookmark: Option<String>,
}
Expand description
Memory-optimized, iterable document collection, mostly returned in calls
that involve multiple documents results Can target a specific index through
implementation of Index
and IndexMut
Fields§
§offset: Option<u32>
§rows: Vec<T>
§total_rows: u32
§bookmark: Option<String>
Implementations§
source§impl<T: TypedCouchDocument> DocumentCollection<T>
impl<T: TypedCouchDocument> DocumentCollection<T>
sourcepub fn new(doc: AllDocsResponse<T>) -> DocumentCollection<T>
pub fn new(doc: AllDocsResponse<T>) -> DocumentCollection<T>
Create a new document collection from an AllDocsResponse
§Panics
Panics if the total_rows
field is greater than u32::MAX
sourcepub fn new_from_documents(
docs: Vec<T>,
bookmark: Option<String>
) -> DocumentCollection<T>
pub fn new_from_documents( docs: Vec<T>, bookmark: Option<String> ) -> DocumentCollection<T>
Create a new document collection from a Vec
of documents
§Panics
Panics if the total_rows
field is greater than u32::MAX
sourcepub fn new_from_values(
docs: Vec<Value>,
bookmark: Option<String>
) -> DocumentCollection<T>
pub fn new_from_values( docs: Vec<Value>, bookmark: Option<String> ) -> DocumentCollection<T>
Create a new document collection from a Vec
of Value
documents
§Panics
Panics if the total_rows
field is greater than u32::MAX
Trait Implementations§
source§impl<T: Clone + TypedCouchDocument> Clone for DocumentCollection<T>
impl<T: Clone + TypedCouchDocument> Clone for DocumentCollection<T>
source§fn clone(&self) -> DocumentCollection<T>
fn clone(&self) -> DocumentCollection<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug + TypedCouchDocument> Debug for DocumentCollection<T>
impl<T: Debug + TypedCouchDocument> Debug for DocumentCollection<T>
source§impl<T: TypedCouchDocument> Default for DocumentCollection<T>
impl<T: TypedCouchDocument> Default for DocumentCollection<T>
source§impl<T: TypedCouchDocument> Index<usize> for DocumentCollection<T>
impl<T: TypedCouchDocument> Index<usize> for DocumentCollection<T>
source§impl<T: TypedCouchDocument> IndexMut<usize> for DocumentCollection<T>
impl<T: TypedCouchDocument> IndexMut<usize> for DocumentCollection<T>
source§impl<T: PartialEq + TypedCouchDocument> PartialEq for DocumentCollection<T>
impl<T: PartialEq + TypedCouchDocument> PartialEq for DocumentCollection<T>
source§fn eq(&self, other: &DocumentCollection<T>) -> bool
fn eq(&self, other: &DocumentCollection<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Eq + TypedCouchDocument> Eq for DocumentCollection<T>
impl<T: TypedCouchDocument> StructuralPartialEq for DocumentCollection<T>
Auto Trait Implementations§
impl<T> Freeze for DocumentCollection<T>
impl<T> RefUnwindSafe for DocumentCollection<T>where
T: RefUnwindSafe,
impl<T> Send for DocumentCollection<T>where
T: Send,
impl<T> Sync for DocumentCollection<T>where
T: Sync,
impl<T> Unpin for DocumentCollection<T>where
T: Unpin,
impl<T> UnwindSafe for DocumentCollection<T>where
T: UnwindSafe,
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