async_ffi

Type Alias FfiFuture

Source
pub type FfiFuture<T> = BorrowingFfiFuture<'static, T>;
Expand description

The FFI compatible future type with Send bound and 'static lifetime, which is needed for most use cases.

See module level documentation for more details.

Aliased Type§

struct FfiFuture<T>(/* private fields */);

Implementations

Source§

impl<'a, T> BorrowingFfiFuture<'a, T>

Source

pub fn new<F: Future<Output = T> + Send + 'a>(fut: F) -> Self

Convert an std::future::Future implementing Send into a FFI-compatible FfiFuture.

Usually FutureExt::into_ffi is preferred and is identical to this method.

Trait Implementations

Source§

impl<T> Future for BorrowingFfiFuture<'_, T>

Source§

type Output = T

The type of value produced on completion.
Source§

fn poll(self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll<Self::Output>

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
Source§

impl<'a, T> GetStaticEquivalent_ for BorrowingFfiFuture<'a, T>
where T: __StableAbi,

Source§

type StaticEquivalent = _static_BorrowingFfiFuture<'static, <T as GetStaticEquivalent_>::StaticEquivalent>

The 'static equivalent of Self
Source§

impl<'a, T> StableAbi for BorrowingFfiFuture<'a, T>
where T: __StableAbi,

Source§

const LAYOUT: &'static TypeLayout = _

The layout of the type provided by implementors.
Source§

type IsNonZeroType = <LocalBorrowingFfiFuture<'a, T> as StableAbi>::IsNonZeroType

Whether this type has a single invalid bit-pattern. Read more
Source§

const ABI_CONSTS: AbiConsts = _

const-equivalents of the associated types.
Source§

impl<T> Send for BorrowingFfiFuture<'_, T>