Enum bonsaidb::core::schema::view::ViewUpdatePolicy
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§
§impl Clone for ViewUpdatePolicy
impl Clone for ViewUpdatePolicy
§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 more§impl Debug for ViewUpdatePolicy
impl Debug for ViewUpdatePolicy
§impl Default for ViewUpdatePolicy
impl Default for ViewUpdatePolicy
§fn default() -> ViewUpdatePolicy
fn default() -> ViewUpdatePolicy
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for ViewUpdatePolicy
impl<'de> Deserialize<'de> for ViewUpdatePolicy
§fn deserialize<__D>(
__deserializer: __D
) -> Result<ViewUpdatePolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ViewUpdatePolicy, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for ViewUpdatePolicy
impl Display for ViewUpdatePolicy
§impl PartialEq<ViewUpdatePolicy> for ViewUpdatePolicy
impl PartialEq<ViewUpdatePolicy> for ViewUpdatePolicy
§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 ==
.§impl Serialize for ViewUpdatePolicy
impl Serialize for ViewUpdatePolicy
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.