uniffi::ffi::rustfuture

Function rust_future_cancel

Source
pub unsafe fn rust_future_cancel<ReturnType>(handle: RustFutureHandle)
Expand description

Cancel a Rust future

Any current and future continuations will be immediately called with RustFuturePoll::Ready.

This is needed for languages like Swift, which continuation to wait for the continuation to be called when tasks are cancelled.

ยงSafety

The RustFutureHandle must not previously have been passed to rust_future_free