pub struct DriverReadOnlyLock<T> { /* private fields */ }Expand description
there are no read-only locks in the existing rust library that prevent executors from having write access. this pair of classes allows a driver application to instantiate a RwLock on an object, and then issue read-only clones of that lock to executors in a parallel setup.
see https://stackoverflow.com/a/68908523
Implementations§
Source§impl<T> DriverReadOnlyLock<T>
impl<T> DriverReadOnlyLock<T>
pub fn new(val: T) -> Self
pub fn write(&self) -> LockResult<RwLockWriteGuard<'_, T>>
pub fn read(&self) -> LockResult<RwLockReadGuard<'_, T>>
pub fn read_only(&self) -> ExecutorReadOnlyLock<T>
Auto Trait Implementations§
impl<T> Freeze for DriverReadOnlyLock<T>
impl<T> RefUnwindSafe for DriverReadOnlyLock<T>
impl<T> Send for DriverReadOnlyLock<T>
impl<T> Sync for DriverReadOnlyLock<T>
impl<T> Unpin for DriverReadOnlyLock<T>
impl<T> UnsafeUnpin for DriverReadOnlyLock<T>
impl<T> UnwindSafe for DriverReadOnlyLock<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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more