Skip to main content

OwnedBuffer

Type Alias OwnedBuffer 

Source
pub type OwnedBuffer = BufferImpl<'static, Arc<dyn BufferAllocator>, dyn BufferAllocator>;

Aliased Type§

pub struct OwnedBuffer { /* private fields */ }

Implementations§

Source§

impl OwnedBuffer

Source

pub fn split<R>( self, f: impl FnOnce(&mut SplittableBuffer) -> Result<R, Error>, on_complete: impl FnOnce(Result<OwnedBuffer, Error>) + Send + 'static, ) -> Result<R, Error>

Splits the buffer into one or more child OwnedBuffers via f.

When all child OwnedBuffers and SubHandles drop, the merged parent buffer is automatically delivered to on_complete(Ok(parent_buffer)). If an error occurs via f or during sub-operation execution, on_complete(Err(e)) is delivered.