pub struct TxnId(/* private fields */);Expand description
Identifies the transaction that owns a lock request.
The lock manager uses this only for equality and hashing: it tracks which requests belong together so a transaction can re-acquire, upgrade, or release its own locks. Reusing a retired id for a new transaction is safe as long as the previous transaction has released everything first.
§Examples
use lock_db::TxnId;
let t = TxnId::new(42);
assert_eq!(t.get(), 42);
assert_eq!(TxnId::from(42), t);Implementations§
Trait Implementations§
impl Copy for TxnId
Source§impl<'de> Deserialize<'de> for TxnId
impl<'de> Deserialize<'de> for TxnId
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 TxnId
Source§impl Ord for TxnId
impl Ord for TxnId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for TxnId
impl PartialOrd for TxnId
impl StructuralPartialEq for TxnId
Auto Trait Implementations§
impl Freeze for TxnId
impl RefUnwindSafe for TxnId
impl Send for TxnId
impl Sync for TxnId
impl Unpin for TxnId
impl UnsafeUnpin for TxnId
impl UnwindSafe for TxnId
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