Skip to main content

OutputBuffer

Trait OutputBuffer 

Source
pub unsafe trait OutputBuffer<T>: Sized {
    // Required methods
    fn slots(&mut self) -> &mut [MaybeUninit<T>];
    unsafe fn finish(
        self,
        len: usize,
        allocator: &BufferAllocatorRef,
    ) -> ArrayRef;
}
Expand description

Engine-owned storage for collecting independent row values.

The executor initializes a prefix of slots, then calls finish. Dropping the buffer instead abandons the output, including after an error or unwind.

§Safety

  • Access through this trait must preserve slot count and contents between calls to slots, including across moves of the buffer.
  • Dropping the buffer must be safe with any subset of its slots initialized.

Violating these requirements can cause undefined behavior in an executor or sink.

Required Methods§

Source

fn slots(&mut self) -> &mut [MaybeUninit<T>]

Writable capacity whose initialized prefix is published by finish.

Source

unsafe fn finish(self, len: usize, allocator: &BufferAllocatorRef) -> ArrayRef

Publish the first len slots as an all-valid column, reusing storage where possible.

The column must contain exactly len rows in slot order. Any new payload buffers must use allocator.

§Safety

The first len slots must exist and contain initialized values. Violating this requirement can cause undefined behavior.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl OutputBuffer<bool> for BufferMut<bool>

Source§

fn slots(&mut self) -> &mut [MaybeUninit<bool>]

Source§

unsafe fn finish(self, len: usize, allocator: &BufferAllocatorRef) -> ArrayRef

Source§

impl<T: NativePType> OutputBuffer<T> for BufferMut<T>

Source§

fn slots(&mut self) -> &mut [MaybeUninit<T>]

Source§

unsafe fn finish(self, len: usize, _allocator: &BufferAllocatorRef) -> ArrayRef

Implementors§