Struct aragog::query::RecordQueryResult [−][src]
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]
fn from(query_result: JsonQueryResult) -> Self
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for RecordQueryResult<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for RecordQueryResult<T> where
T: Send,
T: Send,
impl<T> Sync for RecordQueryResult<T> where
T: Sync,
T: Sync,
impl<T> Unpin for RecordQueryResult<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for RecordQueryResult<T> where
T: UnwindSafe,
T: UnwindSafe,
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, 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>,