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,

§

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,

§

type Duration = <T as RawMutexTimed>::Duration

Duration type used for try_lock_for.
§

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,

§

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,

§

type Duration = <T as RawRwLockTimed>::Duration

Duration type used for try_lock_for.
§

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

§

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

§

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.