pub struct EntryReadGuard<T: Any + Send + Sync> { /* private fields */ }Expand description
Read-Locked entry guard. Until this value is dropped, a read lock is held on the entry.
Implements Deref, providing read access to the locked T.
Implementations§
Source§impl<T: Any + Send + Sync> EntryReadGuard<T>
impl<T: Any + Send + Sync> EntryReadGuard<T>
Sourcepub fn try_new(key: &str, entry: &Arc<RwLock<EntryData>>) -> Result<Self, Error>
pub fn try_new(key: &str, entry: &Arc<RwLock<EntryData>>) -> Result<Self, Error>
Returns a read guard to a &mut T.
§Errors
Error::IsLockedif the entry is locked by someone else.Error::WrongTypeif the entry has not the expected typeT.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for EntryReadGuard<T>
impl<T> !RefUnwindSafe for EntryReadGuard<T>
impl<T> !Send for EntryReadGuard<T>
impl<T> !Sync for EntryReadGuard<T>
impl<T> Unpin for EntryReadGuard<T>
impl<T> !UnwindSafe for EntryReadGuard<T>
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