Skip to main content

BlockLiteral

Struct BlockLiteral 

Source
#[repr(C)]
pub struct BlockLiteral<Closure> { pub isa: *const c_void, pub flags: i32, pub reserved: i32, pub invoke: *const c_void, pub descriptor: *const c_void, pub closure: Closure, }
Expand description

Block literal structure matching Clang’s Block_literal_1.

This is the actual block object passed to Objective-C APIs. The layout must exactly match what Clang generates.

Fields§

§isa: *const c_void

ISA pointer - points to _NSConcreteStackBlock or _NSConcreteGlobalBlock.

§flags: i32

Block flags.

§reserved: i32

Reserved (always 0).

§invoke: *const c_void

Invoke function pointer - the actual function to call.

§descriptor: *const c_void

Pointer to the block descriptor.

§closure: Closure

Captured closure data.

Auto Trait Implementations§

§

impl<Closure> Freeze for BlockLiteral<Closure>
where Closure: Freeze,

§

impl<Closure> RefUnwindSafe for BlockLiteral<Closure>
where Closure: RefUnwindSafe,

§

impl<Closure> !Send for BlockLiteral<Closure>

§

impl<Closure> !Sync for BlockLiteral<Closure>

§

impl<Closure> Unpin for BlockLiteral<Closure>
where Closure: Unpin,

§

impl<Closure> UnwindSafe for BlockLiteral<Closure>
where Closure: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.