[−][src]Struct qualia::Collection
A reference to the set of objects matching a given query, as returned by Store::all()
or
Store::query()
.
All actions on a collection are lazy; no queries are run or objects fetched until a method is called. The collection also doesn't hold on to the objects; if any of them are deleted or modified, future calls will return the new state.
A collection may be used multiple times. For instance, it's valid to call
.len()
and
.iter()
on the same Collection
object.
Implementations
impl<'a> Collection<'a>
[src]
pub fn len(&self) -> Result<usize>
[src]
Get the number of objects in the collection.
pub fn exists(&self) -> Result<bool>
[src]
Returns true if there are any objects in the collection.
pub fn iter(&self) -> Result<impl Iterator<Item = Object> + 'a>
[src]
Iterate over all objects in the collection.
This prefetches all objects in the collection so that errors can be reported early.
pub fn iter_as<T: ObjectShape + 'a>(
&self
) -> Result<impl Iterator<Item = T> + 'a>
[src]
&self
) -> Result<impl Iterator<Item = T> + 'a>
Iterate over all objects in the collection, converting them to the given shape.
This prefetches all objects in the collection so that errors can be reported early.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Collection<'a>
[src]
impl<'a> !Send for Collection<'a>
[src]
impl<'a> !Sync for Collection<'a>
[src]
impl<'a> Unpin for Collection<'a>
[src]
impl<'a> !UnwindSafe for Collection<'a>
[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, 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>,