pub struct RcBlock<A, R> { /* private fields */ }
Expand description
A reference-counted Objective-C block.
Implementations§
source§impl<A, R> RcBlock<A, R>
impl<A, R> RcBlock<A, R>
sourcepub unsafe fn new(ptr: *mut Block<A, R>) -> Self
pub unsafe fn new(ptr: *mut Block<A, R>) -> Self
Construct an RcBlock
for the given block without copying it.
The caller must ensure the block has a +1 reference count.
Unsafe because ptr
must point to a valid Block
and must have a +1
reference count or it will be overreleased when the RcBlock
is
dropped.
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.
Unsafe because 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§
Auto Trait Implementations§
impl<A, R> RefUnwindSafe for RcBlock<A, R>
impl<A, R> !Send for RcBlock<A, R>
impl<A, R> !Sync for RcBlock<A, R>
impl<A, R> Unpin for RcBlock<A, R>
impl<A, R> UnwindSafe for RcBlock<A, R>
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