Enum tea_sdk::actor_txns::context::ReadConflictMode
pub enum ReadConflictMode {
CreditOk,
DebitOk,
BothOk,
BothConflict,
}
Expand description
ReadConflictMode is used to determine if other context have a Credit or Debit operation, will that cause this READ operation invalid. For example, if I read an account balance, and if it is greater than a certain amount then running my logic. In this case, if there is another concurrent credit operation, my logic is still valid. Because credit will just increase the account balance. my original logic “greater than” is still valid. But if there was a Debit operation, my logic might be “invalid” because the debit reduce the balance, that my “greater than” logic might be fail. In this case, the read is conflict. It may cause a rerun when merge Those four enum values means in what situation, my read will be valid / invalid These values are important when running a context merge or rebase
Variants§
Trait Implementations§
§impl Clone for ReadConflictMode
impl Clone for ReadConflictMode
§fn clone(&self) -> ReadConflictMode
fn clone(&self) -> ReadConflictMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ReadConflictMode
impl Debug for ReadConflictMode
§impl<'de> Deserialize<'de> for ReadConflictMode
impl<'de> Deserialize<'de> for ReadConflictMode
§fn deserialize<__D>(
__deserializer: __D
) -> Result<ReadConflictMode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ReadConflictMode, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl PartialEq for ReadConflictMode
impl PartialEq for ReadConflictMode
§fn eq(&self, other: &ReadConflictMode) -> bool
fn eq(&self, other: &ReadConflictMode) -> bool
self
and other
values to be equal, and is used
by ==
.§impl Serialize for ReadConflictMode
impl Serialize for ReadConflictMode
§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,
impl Copy for ReadConflictMode
impl Eq for ReadConflictMode
impl StructuralEq for ReadConflictMode
impl StructuralPartialEq for ReadConflictMode
Auto Trait Implementations§
impl RefUnwindSafe for ReadConflictMode
impl Send for ReadConflictMode
impl Sync for ReadConflictMode
impl Unpin for ReadConflictMode
impl UnwindSafe for ReadConflictMode
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.