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
sourceimpl Clone for AccessPolicy
impl Clone for AccessPolicy
sourcefn clone(&self) -> AccessPolicy
fn clone(&self) -> AccessPolicy
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for AccessPolicy
impl Debug for AccessPolicy
sourceimpl<'de> Deserialize<'de> for AccessPolicy
impl<'de> Deserialize<'de> for AccessPolicy
sourcefn 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
sourceimpl Serialize for AccessPolicy
impl Serialize 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more