pub struct WriteChunk<'a, T: Send + 'static>(_, _);
Expand description

Structure for writing into multiple (Default-initialized) slots in one go.

This is returned from Producer::write_chunk().

To obtain uninitialized slots, use Producer::write_chunk_uninit() instead, which also allows moving items from an iterator into the ring buffer by means of WriteChunkUninit::fill_from_iter().

Implementations

Returns two slices for writing to the requested slots.

All slots are initially filled with their Default value.

The first slice can only be empty if 0 slots have been requested. If the first slice contains all requested slots, the second one is empty.

After writing to the slots, they are not automatically made available to be read by the Consumer. This has to be explicitly done by calling commit() or commit_all(). If items are written but not committed afterwards, they will not become available for reading and they will be leaked (which is only relevant if T implements Drop).

Makes the first n slots of the chunk available for reading.

The rest of the chunk is dropped.

Panics

Panics if n is greater than the number of slots in the chunk.

Makes the whole chunk available for reading.

Returns the number of slots in the chunk.

Returns true if the chunk contains no slots.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Fills all slots with the Default value.

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.

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.