pub struct BrwLockPiWriteGuard<'a, Class: LockClass, P: ExclusiveLockPolicy<RawBrwLockPi> = <RawBrwLockPi as RawLock>::DefaultPolicy> { /* private fields */ }Expand description
A validation guard representing writer lock ownership and active list participation.
Implementations§
Source§impl<'a, Class: LockClass, P: ExclusiveLockPolicy<RawBrwLockPi>> BrwLockPiWriteGuard<'a, Class, P>
impl<'a, Class: LockClass, P: ExclusiveLockPolicy<RawBrwLockPi>> BrwLockPiWriteGuard<'a, Class, P>
Sourcepub fn new(lock: &'a BrwLockPi<Class>) -> impl PinInit<Self, Infallible>where
P: ExclusiveLockPolicy<RawBrwLockPi, AcquireArgs = ()>,
pub fn new(lock: &'a BrwLockPi<Class>) -> impl PinInit<Self, Infallible>where
P: ExclusiveLockPolicy<RawBrwLockPi, AcquireArgs = ()>,
Creates a new stack-pinned validation guard initialization block.
Sourcepub fn token(&self) -> &LockToken<'a, Class>
pub fn token(&self) -> &LockToken<'a, Class>
Returns a shared reference to the lock proof LockToken.
Sourcepub fn token_mut(self: Pin<&mut Self>) -> &mut LockToken<'a, Class>
pub fn token_mut(self: Pin<&mut Self>) -> &mut LockToken<'a, Class>
Returns a mutable reference to the lock proof LockToken inside this pinned projection.
Sourcepub fn is_locked_by(&self, target: &BrwLockPi<Class>) -> bool
pub fn is_locked_by(&self, target: &BrwLockPi<Class>) -> bool
Returns true if this guard holds the given target lock instance.
Sourcepub fn call_unlocked<R, F: FnOnce() -> R>(self: Pin<&mut Self>, f: F) -> R
pub fn call_unlocked<R, F: FnOnce() -> R>(self: Pin<&mut Self>, f: F) -> R
Temporarily releases the write lock before executing the given callable f and then
re-acquires the write lock.
Trait Implementations§
Source§impl<'a, Class: LockClass, P: ExclusiveLockPolicy<RawBrwLockPi>> Drop for BrwLockPiWriteGuard<'a, Class, P>
impl<'a, Class: LockClass, P: ExclusiveLockPolicy<RawBrwLockPi>> Drop for BrwLockPiWriteGuard<'a, Class, P>
Auto Trait Implementations§
impl<'a, Class, P = <LockdepTracked<RawBrwLockPiStorage> as RawLock>::DefaultPolicy> !RefUnwindSafe for BrwLockPiWriteGuard<'a, Class, P>
impl<'a, Class, P = <LockdepTracked<RawBrwLockPiStorage> as RawLock>::DefaultPolicy> !Send for BrwLockPiWriteGuard<'a, Class, P>
impl<'a, Class, P = <LockdepTracked<RawBrwLockPiStorage> as RawLock>::DefaultPolicy> !Sync for BrwLockPiWriteGuard<'a, Class, P>
impl<'a, Class, P = <LockdepTracked<RawBrwLockPiStorage> as RawLock>::DefaultPolicy> !UnwindSafe for BrwLockPiWriteGuard<'a, Class, P>
impl<'a, Class, P> Freeze for BrwLockPiWriteGuard<'a, Class, P>where
&'a BrwLockPi<Class>: Freeze,
<P as LockPolicy<LockdepTracked<RawBrwLockPiStorage>>>::GuardState: Freeze,
LockToken<'a, Class>: Freeze,
impl<'a, Class, P> Unpin for BrwLockPiWriteGuard<'a, Class, P>where
&'a BrwLockPi<Class>: Unpin,
<P as LockPolicy<LockdepTracked<RawBrwLockPiStorage>>>::GuardState: Unpin,
LockToken<'a, Class>: Unpin,
impl<'a, Class, P> UnsafeUnpin for BrwLockPiWriteGuard<'a, Class, P>where
&'a BrwLockPi<Class>: UnsafeUnpin,
<P as LockPolicy<LockdepTracked<RawBrwLockPiStorage>>>::GuardState: UnsafeUnpin,
LockToken<'a, Class>: UnsafeUnpin,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>
Initializes
slot. Read moreSource§fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
First initializes the value using
self then calls the function f with the initialized
value. Read more