Struct vstd::rwlock::ReadHandle
source · pub struct ReadHandle<'a, V, Pred: RwLockPredicate<V>> { /* private fields */ }
Expand description
Handle obtained for a shared read-lock from an RwLock
.
Warning: The lock is NOT released automatically when the handle
is dropped. You must call release_read
.
Verus does not check that lock is released.
Implementations§
source§impl<'a, V, Pred: RwLockPredicate<V>> ReadHandle<'a, V, Pred>
impl<'a, V, Pred: RwLockPredicate<V>> ReadHandle<'a, V, Pred>
sourcepub exec fn borrow<'b>(&'b self) -> t : &'b V
pub exec fn borrow<'b>(&'b self) -> t : &'b V
ensures
t == self.view(),
Obtain a shared reference to the object contained in the lock.
sourcepub proof fn lemma_readers_match(tracked
read_handle1: &ReadHandle<'_, V, Pred>,
tracked read_handle2: &ReadHandle<'_, V, Pred>
)
pub proof fn lemma_readers_match(tracked read_handle1: &ReadHandle<'_, V, Pred>, tracked read_handle2: &ReadHandle<'_, V, Pred> )
requires
read_handle1.rwlock() == read_handle2.rwlock(),
ensures(equal(read_handle1.view(), read_handle2.view())),
sourcepub exec fn release_read(self)
pub exec fn release_read(self)
Auto Trait Implementations§
impl<'a, V, Pred> !RefUnwindSafe for ReadHandle<'a, V, Pred>
impl<'a, V, Pred> Send for ReadHandle<'a, V, Pred>
impl<'a, V, Pred> Sync for ReadHandle<'a, V, Pred>
impl<'a, V, Pred> Unpin for ReadHandle<'a, V, Pred>
impl<'a, V, Pred> !UnwindSafe for ReadHandle<'a, V, Pred>
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