Skip to main content

DowngradableWriteGuard

Trait DowngradableWriteGuard 

Source
pub trait DowngradableWriteGuard: DerefMut {
    type DowngradeResult: Deref<Target = Self::Target>;
    type DowngradeToUpgradableResult: UpgradableReadGuard<UpgradeToDowngradableResult = Self, Target = Self::Target>;

    // Required methods
    fn downgrade(self) -> Self::DowngradeResult;
    fn downgrade_to_upgradable(self) -> Self::DowngradeToUpgradableResult;
}
Expand description

Provides an interface for downgrading downgradable write guards.

§Example

See the GuardedTarget docs for implementation examples.

Required Associated Types§

Source

type DowngradeResult: Deref<Target = Self::Target>

Self::downgrade return type.

Source

type DowngradeToUpgradableResult: UpgradableReadGuard<UpgradeToDowngradableResult = Self, Target = Self::Target>

Required Methods§

Source

fn downgrade(self) -> Self::DowngradeResult

Downgrades the write guard to a read guard.

Source

fn downgrade_to_upgradable(self) -> Self::DowngradeToUpgradableResult

Downgrades the write guard to an upgradable read guard.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T: ?Sized> DowngradableWriteGuard for &'a mut T

Source§

impl<'a, T> DowngradableWriteGuard for RwLockWriteGuard<'a, T>

Implementors§