tracing_mutex::lockapi

Struct TracingWrapper

Source
pub struct TracingWrapper<T> { /* private fields */ }
Expand description

Tracing wrapper for all lock_api traits.

This wrapper implements any of the locking traits available, given that the wrapped type implements them. As such, this wrapper can be used both for normal mutexes and rwlocks.

Trait Implementations§

Source§

impl<T: Debug> Debug for TracingWrapper<T>

Source§

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

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

impl<T: Default> Default for TracingWrapper<T>

Source§

fn default() -> TracingWrapper<T>

Returns the “default value” for a type. Read more
Source§

impl<T> RawMutex for TracingWrapper<T>
where T: RawMutex,

Source§

type GuardMarker = GuardNoSend

Always equal to GuardNoSend, as an implementation detail in the tracking system requires this behaviour. May change in the future to reflect the actual guard type from the wrapped primitive.

Source§

const INIT: Self = _

Initial value for an unlocked mutex.
Source§

fn lock(&self)

Acquires this mutex, blocking the current thread until it is able to do so.
Source§

fn try_lock(&self) -> bool

Attempts to acquire this mutex without blocking. Returns true if the lock was successfully acquired and false otherwise.
Source§

unsafe fn unlock(&self)

Unlocks this mutex. Read more
Source§

fn is_locked(&self) -> bool

Checks whether the mutex is currently locked.
Source§

impl<T> RawMutexFair for TracingWrapper<T>
where T: RawMutexFair,

Source§

unsafe fn unlock_fair(&self)

Unlocks this mutex using a fair unlock protocol. Read more
Source§

unsafe fn bump(&self)

Temporarily yields the mutex to a waiting thread if there is one. Read more
Source§

impl<T> RawMutexTimed for TracingWrapper<T>
where T: RawMutexTimed,

Source§

type Duration = <T as RawMutexTimed>::Duration

Duration type used for try_lock_for.
Source§

type Instant = <T as RawMutexTimed>::Instant

Instant type used for try_lock_until.
Source§

fn try_lock_for(&self, timeout: Self::Duration) -> bool

Attempts to acquire this lock until a timeout is reached.
Source§

fn try_lock_until(&self, timeout: Self::Instant) -> bool

Attempts to acquire this lock until a timeout is reached.
Source§

impl<T> RawRwLock for TracingWrapper<T>
where T: RawRwLock,

Source§

type GuardMarker = GuardNoSend

Always equal to GuardNoSend, as an implementation detail in the tracking system requires this behaviour. May change in the future to reflect the actual guard type from the wrapped primitive.

Source§

const INIT: Self = _

Initial value for an unlocked RwLock.
Source§

fn lock_shared(&self)

Acquires a shared lock, blocking the current thread until it is able to do so.
Source§

fn try_lock_shared(&self) -> bool

Attempts to acquire a shared lock without blocking.
Source§

unsafe fn unlock_shared(&self)

Releases a shared lock. Read more
Source§

fn lock_exclusive(&self)

Acquires an exclusive lock, blocking the current thread until it is able to do so.
Source§

fn try_lock_exclusive(&self) -> bool

Attempts to acquire an exclusive lock without blocking.
Source§

unsafe fn unlock_exclusive(&self)

Releases an exclusive lock. Read more
Source§

fn is_locked(&self) -> bool

Checks if this RwLock is currently locked in any way.
Source§

fn is_locked_exclusive(&self) -> bool

Check if this RwLock is currently exclusively locked.
Source§

impl<T> RawRwLockDowngrade for TracingWrapper<T>

Source§

unsafe fn downgrade(&self)

Atomically downgrades an exclusive lock into a shared lock without allowing any thread to take an exclusive lock in the meantime. Read more
Source§

impl<T> RawRwLockFair for TracingWrapper<T>
where T: RawRwLockFair,

Source§

unsafe fn unlock_shared_fair(&self)

Releases a shared lock using a fair unlock protocol. Read more
Source§

unsafe fn unlock_exclusive_fair(&self)

Releases an exclusive lock using a fair unlock protocol. Read more
Source§

unsafe fn bump_shared(&self)

Temporarily yields a shared lock to a waiting thread if there is one. Read more
Source§

unsafe fn bump_exclusive(&self)

Temporarily yields an exclusive lock to a waiting thread if there is one. Read more
Source§

impl<T> RawRwLockRecursive for TracingWrapper<T>

Source§

fn lock_shared_recursive(&self)

Acquires a shared lock without deadlocking in case of a recursive lock.
Source§

fn try_lock_shared_recursive(&self) -> bool

Attempts to acquire a shared lock without deadlocking in case of a recursive lock.
Source§

impl<T> RawRwLockRecursiveTimed for TracingWrapper<T>

Source§

fn try_lock_shared_recursive_for(&self, timeout: Self::Duration) -> bool

Attempts to acquire a shared lock until a timeout is reached, without deadlocking in case of a recursive lock.
Source§

fn try_lock_shared_recursive_until(&self, timeout: Self::Instant) -> bool

Attempts to acquire a shared lock until a timeout is reached, without deadlocking in case of a recursive lock.
Source§

impl<T> RawRwLockTimed for TracingWrapper<T>
where T: RawRwLockTimed,

Source§

type Duration = <T as RawRwLockTimed>::Duration

Duration type used for try_lock_for.
Source§

type Instant = <T as RawRwLockTimed>::Instant

Instant type used for try_lock_until.
Source§

fn try_lock_shared_for(&self, timeout: Self::Duration) -> bool

Attempts to acquire a shared lock until a timeout is reached.
Source§

fn try_lock_shared_until(&self, timeout: Self::Instant) -> bool

Attempts to acquire a shared lock until a timeout is reached.
Source§

fn try_lock_exclusive_for(&self, timeout: Self::Duration) -> bool

Attempts to acquire an exclusive lock until a timeout is reached.
Source§

fn try_lock_exclusive_until(&self, timeout: Self::Instant) -> bool

Attempts to acquire an exclusive lock until a timeout is reached.
Source§

impl<T> RawRwLockUpgrade for TracingWrapper<T>

Source§

fn lock_upgradable(&self)

Acquires an upgradable lock, blocking the current thread until it is able to do so.
Source§

fn try_lock_upgradable(&self) -> bool

Attempts to acquire an upgradable lock without blocking.
Source§

unsafe fn unlock_upgradable(&self)

Releases an upgradable lock. Read more
Source§

unsafe fn upgrade(&self)

Upgrades an upgradable lock to an exclusive lock. Read more
Source§

unsafe fn try_upgrade(&self) -> bool

Attempts to upgrade an upgradable lock to an exclusive lock without blocking. Read more
Source§

impl<T> RawRwLockUpgradeDowngrade for TracingWrapper<T>

Source§

unsafe fn downgrade_upgradable(&self)

Downgrades an upgradable lock to a shared lock. Read more
Source§

unsafe fn downgrade_to_upgradable(&self)

Downgrades an exclusive lock to an upgradable lock. Read more
Source§

impl<T> RawRwLockUpgradeFair for TracingWrapper<T>

Source§

unsafe fn unlock_upgradable_fair(&self)

Releases an upgradable lock using a fair unlock protocol. Read more
Source§

unsafe fn bump_upgradable(&self)

Temporarily yields an upgradable lock to a waiting thread if there is one. Read more
Source§

impl<T> RawRwLockUpgradeTimed for TracingWrapper<T>

Source§

fn try_lock_upgradable_for(&self, timeout: Self::Duration) -> bool

Attempts to acquire an upgradable lock until a timeout is reached.
Source§

fn try_lock_upgradable_until(&self, timeout: Self::Instant) -> bool

Attempts to acquire an upgradable lock until a timeout is reached.
Source§

unsafe fn try_upgrade_for(&self, timeout: Self::Duration) -> bool

Attempts to upgrade an upgradable lock to an exclusive lock until a timeout is reached. Read more
Source§

unsafe fn try_upgrade_until(&self, timeout: Self::Instant) -> bool

Attempts to upgrade an upgradable lock to an exclusive lock until a timeout is reached. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for TracingWrapper<T>

§

impl<T> RefUnwindSafe for TracingWrapper<T>
where T: RefUnwindSafe,

§

impl<T> Send for TracingWrapper<T>
where T: Send,

§

impl<T> Sync for TracingWrapper<T>
where T: Sync,

§

impl<T> Unpin for TracingWrapper<T>
where T: Unpin,

§

impl<T> UnwindSafe for TracingWrapper<T>
where T: UnwindSafe,

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> 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, 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.