async_ffi

Trait ContextExt

Source
pub trait ContextExt {
    // Required method
    fn with_ffi_context<T, F: FnOnce(&mut FfiContext<'_>) -> T>(
        &mut self,
        closure: F,
    ) -> T;
}
Expand description

Helper trait to provide convenience methods for converting a std::task::Context to FfiContext

Required Methods§

Source

fn with_ffi_context<T, F: FnOnce(&mut FfiContext<'_>) -> T>( &mut self, closure: F, ) -> T

Runs a closure with the std::task::Context as a FfiContext.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> ContextExt for Context<'a>

Source§

fn with_ffi_context<T, F: FnOnce(&mut FfiContext<'_>) -> T>( &mut self, closure: F, ) -> T

Implementors§