Struct dossier::schema::ProjectBySlug
source · pub struct ProjectBySlug;
Trait Implementations§
source§impl Clone for ProjectBySlug
impl Clone for ProjectBySlug
source§fn clone(&self) -> ProjectBySlug
fn clone(&self) -> ProjectBySlug
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CollectionViewSchema for ProjectBySlug
impl CollectionViewSchema for ProjectBySlug
§type View = ProjectBySlug
type View = ProjectBySlug
The view this schema is an implementation of.
source§fn unique(&self) -> bool
fn unique(&self) -> bool
If true, no two documents may emit the same key. Unique views are
updated when the document is saved, allowing for this check to be done
atomically. When a document is updated, all unique views will be
updated, and if any of them fail, the document will not be allowed to
update and an
Error::UniqueKeyViolation
will be
returned.source§fn version(&self) -> u64
fn version(&self) -> u64
The version of the view. Changing this value will cause indexes to be rebuilt.
source§fn map(&self, document: CollectionDocument<Project>) -> ViewMapResult<Self::View>
fn map(&self, document: CollectionDocument<Project>) -> ViewMapResult<Self::View>
The map function for this view. This function is responsible for
emitting entries for any documents that should be contained in this
View. If None is returned, the View will not include the document.
§fn lazy(&self) -> bool
fn lazy(&self) -> bool
Returns whether this view should be lazily updated. If true, views will
be updated only when accessed. If false, views will be updated during
the transaction that is updating the affected documents.
§fn reduce(
&self,
mappings: &[MappedValue<<Self::View as View>::Key, <Self::View as View>::Value>],
rereduce: bool
) -> Result<<Self::View as View>::Value, Error>
fn reduce(
&self,
mappings: &[MappedValue<<Self::View as View>::Key, <Self::View as View>::Value>],
rereduce: bool
) -> Result<<Self::View as View>::Value, Error>
The reduce function for this view. If
Err(Error::ReduceUnimplemented)
is returned, queries that ask for a reduce operation will return an
error. See CouchDB
’s Reduce/Rereduce
documentation
for the design this implementation will be inspired bysource§impl Debug for ProjectBySlug
impl Debug for ProjectBySlug
source§impl View for ProjectBySlug
impl View for ProjectBySlug
§type Collection = Project
type Collection = Project
The collection this view belongs to
impl DefaultViewSerialization for ProjectBySlug
Auto Trait Implementations§
impl RefUnwindSafe for ProjectBySlug
impl Send for ProjectBySlug
impl Sync for ProjectBySlug
impl Unpin for ProjectBySlug
impl UnwindSafe for ProjectBySlug
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ViewSchema for Twhere
T: CollectionViewSchema,
<T as CollectionViewSchema>::View: SerializedView,
<<T as CollectionViewSchema>::View as View>::Collection: SerializedCollection,
impl<T> ViewSchema for Twhere
T: CollectionViewSchema,
<T as CollectionViewSchema>::View: SerializedView,
<<T as CollectionViewSchema>::View as View>::Collection: SerializedCollection,
§fn version(&self) -> u64
fn version(&self) -> u64
The version of the view. Changing this value will cause indexes to be rebuilt.
§fn map(
&self,
document: &BorrowedDocument<'_>
) -> Result<Mappings<<<T as ViewSchema>::View as View>::Key, <<T as ViewSchema>::View as View>::Value>, Error>
fn map(
&self,
document: &BorrowedDocument<'_>
) -> Result<Mappings<<<T as ViewSchema>::View as View>::Key, <<T as ViewSchema>::View as View>::Value>, Error>
The map function for this view. This function is responsible for
emitting entries for any documents that should be contained in this
View. If None is returned, the View will not include the document. See the user guide’s chapter on
views for more information on how map
works.
§fn reduce(
&self,
mappings: &[MappedValue<<<T as ViewSchema>::View as View>::Key, <<T as ViewSchema>::View as View>::Value>],
rereduce: bool
) -> Result<<<T as ViewSchema>::View as View>::Value, Error>
fn reduce(
&self,
mappings: &[MappedValue<<<T as ViewSchema>::View as View>::Key, <<T as ViewSchema>::View as View>::Value>],
rereduce: bool
) -> Result<<<T as ViewSchema>::View as View>::Value, Error>
Returns a value that is produced by reducing a list of
mappings
into a
single value. If rereduce
is true, the values contained in the
mappings have already been reduced at least one time. If an error of
ReduceUnimplemented
is returned,
queries that ask for a reduce operation will return an error. See the
user guide’s chapter on views for more information on how reduce
works.§fn unique(&self) -> bool
fn unique(&self) -> bool
If true, no two documents may emit the same key. Unique views are
updated when the document is saved, allowing for this check to be done
atomically. When a document is updated, all unique views will be
updated, and if any of them fail, the document will not be allowed to
update and an
Error::UniqueKeyViolation
will be
returned.