Skip to main content

TwoArgBlock

Type Alias TwoArgBlock 

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

Block type: void (^)(id, id)

Used for completion handlers: void (^)(MTL::Library*, NS::Error*)

Aliased Type§

pub struct TwoArgBlock { /* private fields */ }

Implementations§

Source§

impl TwoArgBlock

Source

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

Create a block from a closure taking two pointer arguments.

This matches the C++ pattern:

using NewLibraryCompletionHandler = void (^)(MTL::Library*, NS::Error*);