pub enum DataControllerOp {
Nop,
Insert,
Revoke,
Drop,
}Expand description
What the cache controller should do with the initial value that was submitted for data controller processing.
Variants§
Nop
Do nothing, only put the returned update record into the update pool.
Insert
Insert the value into the cache. This is possible for “immutable” records, i.e., those for which it can be guaranteed that they won’t be changed by the backend. For example, if the primary key field is pre-generated by the client application, then inserting the record into the database won’t change it. If the same guarantee can be made for all other fields as well, it means that injecting the value into the cache immediately would have the same effect as inserting it into the database and then reading it back.
Contrary, if there is an auto-increment field in the record, then sending it to the backend and reading it back is mandatory to achieve a consistent final state.
Revoke
Revoke the value from the cache. Useful for cases when the data controller knows that the value must undergo a flushing operation either to be deleted from the backend or to be updated.
Note: There is a nuance in how the cache controller decides to flush an individual record when necessary: if there is an update record for its key but the data record itself is not cached, then it is time to flush that key under certain circumstances. Such circumstances may include, for example, a request to update the data record. Since the cache controller does not know how to apply the update (and the data controller may also be uncertain about this), the only way to provide the user with a valid data record is to flush the update first.
Drop
An extreme case of the Revoke operation. The value is not only revoked from the cache, but the corresponding entry
is also removed from the update pool. This would be an ideal case of an “immutable” record which is inserted and deleted
sufficiently fast to not require being written back to the backend.
Trait Implementations§
Source§impl Clone for DataControllerOp
impl Clone for DataControllerOp
Source§fn clone(&self) -> DataControllerOp
fn clone(&self) -> DataControllerOp
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DataControllerOp
impl Debug for DataControllerOp
impl Copy for DataControllerOp
Auto Trait Implementations§
impl Freeze for DataControllerOp
impl RefUnwindSafe for DataControllerOp
impl Send for DataControllerOp
impl Sync for DataControllerOp
impl Unpin for DataControllerOp
impl UnwindSafe for DataControllerOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.