Struct block::ConcreteBlock

source ·
#[repr(C)]
pub struct ConcreteBlock<A, R, F> { /* private fields */ }
Expand description

An Objective-C block whose size is known at compile time and may be constructed on the stack.

Implementations§

source§

impl<A, R, F> ConcreteBlock<A, R, F>where A: BlockArguments, F: IntoConcreteBlock<A, Ret = R>,

source

pub fn new(closure: F) -> Self

Constructs a ConcreteBlock with the given closure. When the block is called, it will return the value that results from calling the closure.

source§

impl<A, R, F> ConcreteBlock<A, R, F>where F: 'static,

source

pub fn copy(self) -> RcBlock<A, R>

Copy self onto the heap as an RcBlock.

Methods from Deref<Target = Block<A, R>>§

source

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§

source§

impl<A, R, F> Clone for ConcreteBlock<A, R, F>where F: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<A, R, F> Deref for ConcreteBlock<A, R, F>

§

type Target = Block<A, R>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Block<A, R>

Dereferences the value.
source§

impl<A, R, F> DerefMut for ConcreteBlock<A, R, F>

source§

fn deref_mut(&mut self) -> &mut Block<A, R>

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<A, R, F> RefUnwindSafe for ConcreteBlock<A, R, F>where F: RefUnwindSafe,

§

impl<A, R, F> !Send for ConcreteBlock<A, R, F>

§

impl<A, R, F> !Sync for ConcreteBlock<A, R, F>

§

impl<A, R, F> Unpin for ConcreteBlock<A, R, F>where F: Unpin,

§

impl<A, R, F> UnwindSafe for ConcreteBlock<A, R, F>where F: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.