Struct aragog::query::RecordQueryResult[][src]

pub struct RecordQueryResult<T: Record> {
    pub documents: Vec<DatabaseRecord<T>>,
    // some fields omitted
}

Typed Query result

Fields

documents: Vec<DatabaseRecord<T>>

Vector of the returned documents

Implementations

impl<T: Record> RecordQueryResult<T>[src]

pub fn new(documents: Vec<DatabaseRecord<T>>) -> Self[src]

Instantiates a new QueryResult from a document collection

pub fn uniq(self) -> Result<DatabaseRecord<T>, ServiceError>[src]

Returns the only document of the current QueryResult. If there is no document or more than one, a ServiceError::NotFound is returned.

pub fn first(self) -> Option<DatabaseRecord<T>>[src]

Returns the first document of the current QueryResult. Returns None if there are no documents

pub fn last(self) -> Option<DatabaseRecord<T>>[src]

Returns the last document of the current QueryResult. Returns None if there are no documents

pub fn len(&self) -> usize[src]

Returns the length of documents

pub fn is_empty(&self) -> bool[src]

Returns true if no documents were returned

Trait Implementations

impl<T: Debug + Record> Debug for RecordQueryResult<T>[src]

impl<T: Record> From<JsonQueryResult> for RecordQueryResult<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for RecordQueryResult<T> where
    T: RefUnwindSafe

impl<T> Send for RecordQueryResult<T> where
    T: Send

impl<T> Sync for RecordQueryResult<T> where
    T: Sync

impl<T> Unpin for RecordQueryResult<T> where
    T: Unpin

impl<T> UnwindSafe for RecordQueryResult<T> where
    T: UnwindSafe

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> Instrument for T[src]

impl<T> Instrument for T[src]

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

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.