pub struct ArrayHandle<T> { /* private fields */ }Expand description
A handle granting array-wide access to a bimodal_array.
An ArrayHandle represents the capability to acquire an exclusive lock for
the entire collection. The actual lock is held by the returned
ArrayGuard, which provides mutable access to the full slice &mut [T].
§Locking Semantics
- Calling
lockattempts to acquire array-wide exclusive access. - If successful, it returns an
ArrayGuardproviding&mut [T]. - If one or more
ElementGuard<T>values are currently active, lock acquisition fails withBimodalArrayError::CouldNotAcquireArrayLock.
Lock acquisition is non-blocking.
Implementations§
Source§impl<T> ArrayHandle<T>
impl<T> ArrayHandle<T>
Sourcepub fn lock<'a>(&'a mut self) -> Result<ArrayGuard<'a, T>, BimodalArrayError>
pub fn lock<'a>(&'a mut self) -> Result<ArrayGuard<'a, T>, BimodalArrayError>
Attempts to acquire exclusive mutable access to the entire array.
Returns an ArrayGuard on success. If any element guards are
currently active, this method returns
BimodalArrayError::CouldNotAcquireArrayLock.
Lock acquisition is non-blocking.
Trait Implementations§
Source§impl<T> Drop for ArrayHandle<T>
impl<T> Drop for ArrayHandle<T>
impl<T: Send> Send for ArrayHandle<T>
impl<T: Sync> Sync for ArrayHandle<T>
Auto Trait Implementations§
impl<T> Freeze for ArrayHandle<T>
impl<T> RefUnwindSafe for ArrayHandle<T>where
T: RefUnwindSafe,
impl<T> Unpin for ArrayHandle<T>
impl<T> UnsafeUnpin for ArrayHandle<T>
impl<T> UnwindSafe for ArrayHandle<T>where
T: RefUnwindSafe,
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