Skip to main content

DeallocatorBlock

Type Alias DeallocatorBlock 

Source
pub type DeallocatorBlock = RcBlock<Box<dyn Fn(*mut c_void, usize) + Send>>;
Expand description

Block type: void (^)(void*, size_t)

Used for buffer deallocators in newBufferWithBytesNoCopy:...deallocator:.

Aliased Type§

pub struct DeallocatorBlock { /* private fields */ }

Implementations§

Source§

impl DeallocatorBlock

Source

pub fn from_fn<F>(f: F) -> Self
where F: Fn(*mut c_void, usize) + Send + 'static,

Create a block for buffer deallocation.

The closure receives the buffer pointer and its size.