Enum bonsaidb_core::schema::view::ViewUpdatePolicy
source · pub enum ViewUpdatePolicy {
Lazy,
Eager,
Unique,
}
Expand description
The policy under which a View
is updated when documents are saved.
Variants§
Lazy
The view is updated when a query is made. If a document is updated multiple times between queries, the view will only be updated when the query is executed.
Eager
The view is updated during the transaction where documents are being inserted, updated, or removed.
Unique
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.
Implementations§
Trait Implementations§
source§impl Clone for ViewUpdatePolicy
impl Clone for ViewUpdatePolicy
source§fn clone(&self) -> ViewUpdatePolicy
fn clone(&self) -> ViewUpdatePolicy
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 Debug for ViewUpdatePolicy
impl Debug for ViewUpdatePolicy
source§impl Default for ViewUpdatePolicy
impl Default for ViewUpdatePolicy
source§fn default() -> ViewUpdatePolicy
fn default() -> ViewUpdatePolicy
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ViewUpdatePolicy
impl<'de> Deserialize<'de> for ViewUpdatePolicy
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for ViewUpdatePolicy
impl Display for ViewUpdatePolicy
source§impl PartialEq<ViewUpdatePolicy> for ViewUpdatePolicy
impl PartialEq<ViewUpdatePolicy> for ViewUpdatePolicy
source§fn eq(&self, other: &ViewUpdatePolicy) -> bool
fn eq(&self, other: &ViewUpdatePolicy) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ViewUpdatePolicy
impl Serialize for ViewUpdatePolicy
impl Copy for ViewUpdatePolicy
impl Eq for ViewUpdatePolicy
impl StructuralEq for ViewUpdatePolicy
impl StructuralPartialEq for ViewUpdatePolicy
Auto Trait Implementations§
impl RefUnwindSafe for ViewUpdatePolicy
impl Send for ViewUpdatePolicy
impl Sync for ViewUpdatePolicy
impl Unpin for ViewUpdatePolicy
impl UnwindSafe for ViewUpdatePolicy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more