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
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<AccessPolicy, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub 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
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub 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
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
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more