pub struct BiLock<T>(/* private fields */);Available on crate feature
bilock only.Expand description
A lock shared by two parties.
Implementations§
Source§impl<T> BiLock<T>
impl<T> BiLock<T>
Sourcepub fn new(data: T) -> (Self, Self)
pub fn new(data: T) -> (Self, Self)
Creates a new BiLock wrapping the supplied data, returning two
handles to it.
Sourcepub fn lock(&self) -> BiLockAcquire<'_, T> ⓘ
pub fn lock(&self) -> BiLockAcquire<'_, T> ⓘ
Acquires the lock, returning a future that resolves to a guard
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for BiLock<T>
impl<T> !RefUnwindSafe for BiLock<T>
impl<T> !Send for BiLock<T>
impl<T> !Sync for BiLock<T>
impl<T> Unpin for BiLock<T>
impl<T> UnsafeUnpin for BiLock<T>
impl<T> !UnwindSafe for BiLock<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