pub struct GlobalBlock<F: ?Sized> { /* private fields */ }Expand description
A global Objective-C block that does not capture an environment.
This can be used as an optimization of RcBlock if your closure doesn’t
capture any variables.
This is a smart pointer that Derefs to Block.
It can created and stored in static memory using the global_block!
macro.
Methods from Deref<Target = Block<F>>§
Sourcepub fn copy(&self) -> RcBlock<F>
pub fn copy(&self) -> RcBlock<F>
Copy the block onto the heap as an RcBlock.
The behaviour of this function depends on whether the block is from a
RcBlock or a StackBlock. In the former case, it will bump the
reference-count (just as-if you’d Clone’d the RcBlock), in the
latter case it will construct a new RcBlock from the StackBlock.
This distinction should not matter, except for micro-optimizations.
Trait Implementations§
Source§impl<F: ?Sized> Debug for GlobalBlock<F>
impl<F: ?Sized> Debug for GlobalBlock<F>
impl<F: ?Sized + BlockFn> Send for GlobalBlock<F>
impl<F: ?Sized + BlockFn> Sync for GlobalBlock<F>
Auto Trait Implementations§
impl<F> Freeze for GlobalBlock<F>where
F: ?Sized,
impl<F> !RefUnwindSafe for GlobalBlock<F>
impl<F> Unpin for GlobalBlock<F>
impl<F> !UnwindSafe for GlobalBlock<F>
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