[][src]Struct mongodb_cursor_pagination::PaginatedCursor

pub struct PaginatedCursor { /* fields omitted */ }

The main entry point for finding documents

Methods

impl<'a> PaginatedCursor[src]

pub fn new(
    options: Option<FindOptions>,
    cursor: Option<String>,
    direction: Option<CursorDirections>
) -> Self
[src]

Updates or creates all of the find options to help with pagination and returns a PaginatedCursor object.

Arguments

  • options - Optional find options that you would like to perform any searches with
  • cursor - An optional existing cursor in base64. This would have come from a previous FindResult
  • direction - Determines whether the cursor supplied is for a previous page or the next page. Defaults to Next

pub fn estimated_document_count(
    &self,
    collection: &Collection
) -> Result<i64, CursorError>
[src]

Estimates the number of documents in the collection using collection metadata.

pub fn count_documents(
    &self,
    collection: &Collection,
    query: Option<&Document>
) -> Result<i64, CursorError>
[src]

Gets the number of documents matching filter. Note that using PaginatedCursor::estimated_document_count is recommended instead of this method is most cases.

pub fn find<T>(
    &self,
    collection: &Collection,
    filter: Option<&Document>
) -> Result<FindResult<T>, CursorError> where
    T: Deserialize<'a>, 
[src]

Finds the documents in the collection matching filter.

Trait Implementations

impl Debug for PaginatedCursor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,