pub struct Ref<'slot, T> { /* private fields */ }Expand description
A reference to an entry in a ThingBuf.
A Ref represents the exclusive permission to mutate a given element in a
queue. A Ref<T> implements DerefMut<T> to allow writing to that
element.
Refs are returned by the ThingBuf::push_ref and ThingBuf::pop_ref
methods. When the Ref is dropped, the exclusive write access to that
element is released, and the push or pop operation is completed —
calling push_ref or pop_ref begins a push or pop operation, which ends
when the returned Ref is complete. When the Ref is dropped, the pushed
element will become available to a subsequent pop_ref, or the popped
element will be able to be written to by a push_ref, respectively.
Trait Implementations§
Source§impl<T: Write> Write for Ref<'_, T>
impl<T: Write> Write for Ref<'_, T>
impl<T: Send> Send for Ref<'_, T>
impl<T: Send> Sync for Ref<'_, T>
Auto Trait Implementations§
impl<'slot, T> Freeze for Ref<'slot, T>
impl<'slot, T> !RefUnwindSafe for Ref<'slot, T>
impl<'slot, T> Unpin for Ref<'slot, T>
impl<'slot, T> !UnwindSafe for Ref<'slot, 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