Enum bonsaidb_core::connection::AccessPolicy
source · pub enum AccessPolicy {
UpdateBefore,
UpdateAfter,
NoUpdate,
}
Expand description
Changes how the view’s outdated data will be treated.
Variants§
UpdateBefore
Update any changed documents before returning a response.
UpdateAfter
Return the results, which may be out-of-date, and start an update job in the background. This pattern is useful when you want to ensure you provide consistent response times while ensuring the database is updating in the background.
NoUpdate
Returns the results, which may be out-of-date, and do not start any
background jobs. This mode is useful if you’re using a view as a cache
and have a background process that is responsible for controlling when
data is refreshed and updated. While the default UpdateBefore
shouldn’t have much overhead, this option removes all overhead related
to view updating from the query.
Trait Implementations§
source§impl Clone for AccessPolicy
impl Clone for AccessPolicy
source§fn clone(&self) -> AccessPolicy
fn clone(&self) -> AccessPolicy
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 AccessPolicy
impl Debug for AccessPolicy
source§impl<'de> Deserialize<'de> for AccessPolicy
impl<'de> Deserialize<'de> for AccessPolicy
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 Serialize for AccessPolicy
impl Serialize for AccessPolicy
impl Copy for AccessPolicy
Auto Trait Implementations§
impl RefUnwindSafe for AccessPolicy
impl Send for AccessPolicy
impl Sync for AccessPolicy
impl Unpin for AccessPolicy
impl UnwindSafe for AccessPolicy
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