Struct refuse::WouldDeadlock
source · pub struct WouldDeadlock;Expand description
An error indicating an operation would deadlock.
CollectionGuard::acquire can be called multiple times from the same
thread, but some operations require that all guards for the current thread
have been released before performing. This error signals when an operation
can’t succeed because the current thread has an outstanding guard that must
be dropped for the operation to be able to be performed.
use refuse::{CollectionGuard, WouldDeadlock};
let mut guard1 = CollectionGuard::acquire();
let guard2 = CollectionGuard::acquire();
assert_eq!(guard1.try_collect(), Err(WouldDeadlock));
drop(guard2);
assert_eq!(guard1.try_collect(), Ok(()));Trait Implementations§
source§impl Clone for WouldDeadlock
impl Clone for WouldDeadlock
source§fn clone(&self) -> WouldDeadlock
fn clone(&self) -> WouldDeadlock
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for WouldDeadlock
impl Debug for WouldDeadlock
source§impl Display for WouldDeadlock
impl Display for WouldDeadlock
source§impl PartialEq for WouldDeadlock
impl PartialEq for WouldDeadlock
source§fn eq(&self, other: &WouldDeadlock) -> bool
fn eq(&self, other: &WouldDeadlock) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Copy for WouldDeadlock
impl Eq for WouldDeadlock
impl StructuralPartialEq for WouldDeadlock
Auto Trait Implementations§
impl Freeze for WouldDeadlock
impl RefUnwindSafe for WouldDeadlock
impl Send for WouldDeadlock
impl Sync for WouldDeadlock
impl Unpin for WouldDeadlock
impl UnwindSafe for WouldDeadlock
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