pub struct TurnLocks { /* private fields */ }Expand description
The per-print turn locks.
Implementations§
Source§impl TurnLocks
impl TurnLocks
Sourcepub const fn acquire(&self, print_id: PrintId) -> Acquire<'_> ⓘ
pub const fn acquire(&self, print_id: PrintId) -> Acquire<'_> ⓘ
Wait until no turn is running for this print, then hold it.
Sourcepub fn try_acquire(&self, print_id: PrintId) -> Option<TurnGuard<'_>>
pub fn try_acquire(&self, print_id: PrintId) -> Option<TurnGuard<'_>>
Hold this print’s turn when no turn is running for it, without waiting.
For a caller that may itself be answering the turn that holds it — a read the agent made from inside its own turn — and so must never queue behind that turn.
§Panics
When the turn locks are poisoned, which only a panic while they were being read can leave them.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TurnLocks
impl RefUnwindSafe for TurnLocks
impl Send for TurnLocks
impl Sync for TurnLocks
impl Unpin for TurnLocks
impl UnsafeUnpin for TurnLocks
impl UnwindSafe for TurnLocks
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