DeadlockInfo

Struct DeadlockInfo 

Source
pub struct DeadlockInfo {
    pub source: DeadlockSource,
    pub thread_cycle: Vec<ThreadId>,
    pub thread_waiting_for_locks: Vec<(ThreadId, LockId)>,
    pub lock_order_cycle: Option<Vec<LockId>>,
    pub timestamp: String,
    pub verification_request: Option<(LockId, ThreadId)>,
}
Expand description

Represents the result of deadlock detection

This structure contains detailed information about a detected deadlock, including which threads are involved in the cycle and which locks they are waiting for. This information is passed to the deadlock callback and can be used to diagnose the root cause of the deadlock.

Fields§

§source: DeadlockSource

Source of the deadlock detection

Indicates whether this is a certain deadlock (WaitForGraph) or a suspected deadlock pattern (LockOrderViolation).

§thread_cycle: Vec<ThreadId>

List of threads involved in the deadlock cycle

This is the ordered list of threads that form a cycle in the wait-for graph. For example, if thread 1 is waiting for thread 2, and thread 2 is waiting for thread 1, the cycle would be [1, 2].

§thread_waiting_for_locks: Vec<(ThreadId, LockId)>

Map of threads to locks they’re waiting for

This provides additional context about which specific locks each thread in the cycle is waiting to acquire. Each tuple is (thread_id, lock_id).

§lock_order_cycle: Option<Vec<LockId>>

Lock order violation cycle (if detected via lock ordering)

When a deadlock is detected via lock order violation rather than an actual wait-for cycle, this field contains the cycle of locks that violates the established lock ordering. For example, if lock 1 -> lock 2 -> lock 3 -> lock 1 forms a cycle, this would be Some(vec![1, 2, 3, 1]).

§timestamp: String

Timestamp when the deadlock was detected

ISO-8601 formatted timestamp indicating when the deadlock was detected.

§verification_request: Option<(LockId, ThreadId)>

Optional: Request for the lock wrapper to verify the deadlock

Trait Implementations§

Source§

impl Clone for DeadlockInfo

Source§

fn clone(&self) -> DeadlockInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeadlockInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DeadlockInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DeadlockInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,