pub struct BlockingRWLock { /* private fields */ }Expand description
Cross-process reader-writer lock with kernel-park slow path.
Implementations§
Source§impl BlockingRWLock
impl BlockingRWLock
Sourcepub fn create(base_path: impl AsRef<Path>) -> Result<Self, BlockingRWLockError>
pub fn create(base_path: impl AsRef<Path>) -> Result<Self, BlockingRWLockError>
Create a blocking rwlock. Lays out three files under one
base path: <base>.rwlock.bin for the state atom,
<base>.waker.bin for the waker slots, <base>.wakeup.bin
for the magic + generation atom.
Sourcepub fn open(base_path: impl AsRef<Path>) -> Result<Self, BlockingRWLockError>
pub fn open(base_path: impl AsRef<Path>) -> Result<Self, BlockingRWLockError>
Open an existing blocking rwlock.
Sourcepub fn try_read_lock(
&self,
) -> Result<BlockingReadGuard<'_>, BlockingRWLockError>
pub fn try_read_lock( &self, ) -> Result<BlockingReadGuard<'_>, BlockingRWLockError>
Non-blocking read-lock attempt.
Sourcepub fn try_write_lock(
&self,
) -> Result<BlockingWriteGuard<'_>, BlockingRWLockError>
pub fn try_write_lock( &self, ) -> Result<BlockingWriteGuard<'_>, BlockingRWLockError>
Non-blocking write-lock attempt.
Sourcepub fn read_park(&self) -> Result<BlockingReadGuard<'_>, BlockingRWLockError>
pub fn read_park(&self) -> Result<BlockingReadGuard<'_>, BlockingRWLockError>
Read-lock with kernel-park slow path.
Sourcepub fn read_park_timeout(
&self,
timeout: Duration,
) -> Result<BlockingReadGuard<'_>, BlockingRWLockError>
pub fn read_park_timeout( &self, timeout: Duration, ) -> Result<BlockingReadGuard<'_>, BlockingRWLockError>
Read-lock with bounded wait.
Sourcepub fn write_park(&self) -> Result<BlockingWriteGuard<'_>, BlockingRWLockError>
pub fn write_park(&self) -> Result<BlockingWriteGuard<'_>, BlockingRWLockError>
Write-lock with kernel-park slow path.
Sourcepub fn write_park_timeout(
&self,
timeout: Duration,
) -> Result<BlockingWriteGuard<'_>, BlockingRWLockError>
pub fn write_park_timeout( &self, timeout: Duration, ) -> Result<BlockingWriteGuard<'_>, BlockingRWLockError>
Write-lock with bounded wait.
Sourcepub fn inner(&self) -> &Arc<SharedRWLock> ⓘ
pub fn inner(&self) -> &Arc<SharedRWLock> ⓘ
Inner primitive (sidecar / observability access).
Auto Trait Implementations§
impl Freeze for BlockingRWLock
impl RefUnwindSafe for BlockingRWLock
impl Send for BlockingRWLock
impl Sync for BlockingRWLock
impl Unpin for BlockingRWLock
impl UnsafeUnpin for BlockingRWLock
impl UnwindSafe for BlockingRWLock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more