pub struct CapturingBlock {
pub capture: *mut c_void,
/* private fields */
}Expand description
A block carrying one pointer.
GlobalBlock captures nothing, which is all a block needs when the
receiver only ever calls it — but a completion handler has to reach
something, and the something differs per call. One captured word is enough
for that: it is where the answer gets written.
_NSConcreteStackBlock with no copy/dispose helpers, so a receiver that
copies it gets a memcpy and the capture comes along by value. That is only
sound while the caller outlives the call, which is why this is used with a
wait and not handed to anything that keeps it.
Fields§
§capture: *mut c_voidWhat the invoke function reads, at a fixed offset from the block.
Implementations§
Auto Trait Implementations§
impl !Send for CapturingBlock
impl !Sync for CapturingBlock
impl Freeze for CapturingBlock
impl RefUnwindSafe for CapturingBlock
impl Unpin for CapturingBlock
impl UnsafeUnpin for CapturingBlock
impl UnwindSafe for CapturingBlock
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