Struct block2::GlobalBlock
source · [−]#[repr(C)]pub struct GlobalBlock<A, R = ()> { /* private fields */ }
Expand description
An Objective-C block that does not capture its environment.
This is effectively just a glorified function pointer, and can created and
stored in static memory using the global_block!
macro.
If ConcreteBlock
is the Fn
-block equivalent, this is likewise the
fn
-block equivalent.
Methods from Deref<Target = Block<A, R>>
sourcepub unsafe fn call(&self, args: A) -> R
pub unsafe fn call(&self, args: A) -> R
Call self with the given arguments.
Safety
This invokes foreign code that the caller must verify doesn’t violate any of Rust’s safety rules.
For example, if this block is shared with multiple references, the caller must ensure that calling it will not cause a data race.
Trait Implementations
sourceimpl<A, R> Debug for GlobalBlock<A, R>
impl<A, R> Debug for GlobalBlock<A, R>
sourceimpl<A, R> Deref for GlobalBlock<A, R> where
A: BlockArguments,
R: Encode,
impl<A, R> Deref for GlobalBlock<A, R> where
A: BlockArguments,
R: Encode,
impl<A, R> Send for GlobalBlock<A, R> where
A: BlockArguments,
R: Encode,
impl<A, R> Sync for GlobalBlock<A, R> where
A: BlockArguments,
R: Encode,
Auto Trait Implementations
impl<A, R = ()> !RefUnwindSafe for GlobalBlock<A, R>
impl<A, R> Unpin for GlobalBlock<A, R> where
A: Unpin,
R: Unpin,
impl<A, R = ()> !UnwindSafe for GlobalBlock<A, R>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more