pub struct CompiledQueryBuffer { /* private fields */ }Expand description
Aligned buffer for compiled query data.
Allocated via Layout::from_size_align(len, BUFFER_ALIGN). Standard Box<[u8]>
won’t work—it assumes 1-byte alignment and corrupts dealloc.
Implementations§
Source§impl CompiledQueryBuffer
impl CompiledQueryBuffer
Sourcepub unsafe fn from_external(ptr: *mut u8, len: usize) -> Self
pub unsafe fn from_external(ptr: *mut u8, len: usize) -> Self
Create a view into external memory (mmap’d or borrowed).
§Safety
ptrmust be valid for reads oflenbytesptrmust be aligned toBUFFER_ALIGN- The backing memory must outlive the returned buffer
Sourcepub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Returns a mutable pointer to the buffer start.
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Returns the buffer as a mutable byte slice.