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

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Writes a string slice into this writer, returning whether the write succeeded. Read more

Writes a char into this writer, returning whether the write succeeded. Read more

Glue for usage of the write! macro with implementors of this trait. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.