diff --git a/src/chunks.rs b/src/chunks.rs index dad49ba9..38128cac 100644 --- a/src/chunks.rs +++ b/src/chunks.rs @@ -444,6 +444,10 @@ pub struct WriteChunkUninit<'a, T> { producer: &'a Producer, } +// WriteChunkUninit only exists while a unique reference to the Producer is held. +// It is therefore safe to move it to another thread. +unsafe impl Send for WriteChunkUninit<'_, T> {} + impl WriteChunkUninit<'_, T> { /// Returns two slices for writing to the requested slots. /// @@ -614,6 +618,10 @@ pub struct ReadChunk<'a, T> { consumer: &'a mut Consumer, } +// ReadChunk only exists while a unique reference to the Consumer is held. +// It is therefore safe to move it to another thread. +unsafe impl Send for ReadChunk<'_, T> {} + impl ReadChunk<'_, T> { /// Returns two slices for reading from the requested slots. ///