Enum bonsaidb::core::connection::AccessPolicy
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§
§impl Clone for AccessPolicy
impl Clone for AccessPolicy
§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 more§impl Debug for AccessPolicy
impl Debug for AccessPolicy
§impl<'de> Deserialize<'de> for AccessPolicy
impl<'de> Deserialize<'de> for AccessPolicy
§fn deserialize<__D>(
__deserializer: __D
) -> Result<AccessPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<AccessPolicy, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for AccessPolicy
impl Serialize for AccessPolicy
§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 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§
§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