pub struct GlobalBlock { /* private fields */ }Expand description
An Objective-C block with no captures.
A block is an object whose first word is an isa like any other; what makes
it callable is the invoke pointer at offset 16, which is passed the block
itself as its first argument. With nothing captured there is nothing to copy
or release, so the block can be a plain static tagged BLOCK_IS_GLOBAL —
_NSConcreteGlobalBlock is exactly the isa for that.
Implementations§
Source§impl GlobalBlock
impl GlobalBlock
Sourcepub unsafe fn new(
invoke: *const c_void,
descriptor: &'static BlockDescriptor,
) -> Self
pub unsafe fn new( invoke: *const c_void, descriptor: &'static BlockDescriptor, ) -> Self
Wrap invoke as a block. It is called with the block as its first
argument, then whatever the block’s signature declares.
§Safety
invoke must match the signature the receiver expects, including the
leading block pointer.
Trait Implementations§
impl Sync for GlobalBlock
Auto Trait Implementations§
impl !Send for GlobalBlock
impl Freeze for GlobalBlock
impl RefUnwindSafe for GlobalBlock
impl Unpin for GlobalBlock
impl UnsafeUnpin for GlobalBlock
impl UnwindSafe for GlobalBlock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more