pub enum VictimPolicy {
Youngest,
Oldest,
}Available on crate feature
std only.Expand description
How to choose which transaction in a deadlock cycle to abort.
Both policies break the cycle correctly; they differ only in which member pays. Transaction ids are taken as a proxy for age — a larger id is a transaction that started later.
Variants§
Youngest
Abort the youngest transaction in the cycle (the largest TxnId).
The default. Aborting the most recently started transaction tends to waste the least already-done work.
Oldest
Abort the oldest transaction in the cycle (the smallest TxnId).
Useful when the oldest transaction is the one most likely to be stuck or holding the most locks.
Trait Implementations§
Source§impl Clone for VictimPolicy
impl Clone for VictimPolicy
Source§fn clone(&self) -> VictimPolicy
fn clone(&self) -> VictimPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for VictimPolicy
Source§impl Debug for VictimPolicy
impl Debug for VictimPolicy
Source§impl Default for VictimPolicy
impl Default for VictimPolicy
Source§fn default() -> VictimPolicy
fn default() -> VictimPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for VictimPolicy
impl<'de> Deserialize<'de> for VictimPolicy
Source§fn 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
impl Eq for VictimPolicy
Source§impl Hash for VictimPolicy
impl Hash for VictimPolicy
Source§impl PartialEq for VictimPolicy
impl PartialEq for VictimPolicy
Source§fn eq(&self, other: &VictimPolicy) -> bool
fn eq(&self, other: &VictimPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for VictimPolicy
impl Serialize for VictimPolicy
impl StructuralPartialEq for VictimPolicy
Auto Trait Implementations§
impl Freeze for VictimPolicy
impl RefUnwindSafe for VictimPolicy
impl Send for VictimPolicy
impl Sync for VictimPolicy
impl Unpin for VictimPolicy
impl UnsafeUnpin for VictimPolicy
impl UnwindSafe for VictimPolicy
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
Mutably borrows from an owned value. Read more