Struct qualia::MutableCollection
source · pub struct MutableCollection<'a> { /* private fields */ }
Expand description
A reference to a modifiable set of objects matching a given query, as returned by
Checkpoint::query()
.
All methods of Collection
are available for MutableCollection
.
Implementations§
source§impl<'a> MutableCollection<'a>
impl<'a> MutableCollection<'a>
Methods from Deref<Target = Collection<'a>>§
sourcepub fn iter(&self) -> Result<impl Iterator<Item = Object> + 'a>
pub fn iter(&self) -> Result<impl Iterator<Item = Object> + 'a>
Iterate over all objects in the collection.
This prefetches all objects in the collection so that errors can be reported early.
sourcepub fn one(&self) -> Result<Object>
pub fn one(&self) -> Result<Object>
Get one and only one object from the collection.
Will error if more than one object is returned.
sourcepub fn iter_as<T: ObjectShapePlain + 'a>(
&self
) -> Result<impl Iterator<Item = T> + 'a>
pub fn iter_as<T: ObjectShapePlain + 'a>( &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.
sourcepub fn one_as<T: ObjectShapePlain + 'a>(&self) -> Result<T>
pub fn one_as<T: ObjectShapePlain + 'a>(&self) -> Result<T>
Get one and only one object from the collection, converting it to the given shape.
Will error if more than one object is returned.
sourcepub fn iter_converted<T: ObjectShape + 'a>(
&self,
store: &Store
) -> Result<impl Iterator<Item = T> + 'a>
pub fn iter_converted<T: ObjectShape + 'a>( &self, store: &Store ) -> 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.
sourcepub fn one_converted<T: ObjectShape + 'a>(&self, store: &Store) -> Result<T>
pub fn one_converted<T: ObjectShape + 'a>(&self, store: &Store) -> Result<T>
Get one and only one object from the collection, converting it to the given shape.
Will error if more than one object is returned.