Trait IntoFunction

Source
pub trait IntoFunction<'env, Marker> {
    // Required method
    fn into_function(self) -> DynamicFunction<'env>;
}
Available on crate feature functions only.
Expand description

A trait for types that can be converted into a DynamicFunction.

This trait is automatically implemented for any type that implements ReflectFn and TypedFunction.

See the module-level documentation for more information.

§Trait Parameters

This trait has a Marker type parameter that is used to get around issues with unconstrained type parameters when defining impls with generic arguments or return types. This Marker can be any type, provided it doesn’t conflict with other implementations.

Additionally, it has a lifetime parameter, 'env, that is used to bound the lifetime of the function. For named functions and some closures, this will end up just being 'static, however, closures that borrow from their environment will have a lifetime bound to that environment.

Required Methods§

Source

fn into_function(self) -> DynamicFunction<'env>

Converts Self into a DynamicFunction.

Implementors§

Source§

impl<'env> IntoFunction<'env, ()> for DynamicFunction<'env>

Source§

impl<'env, F, Marker1, Marker2> IntoFunction<'env, (Marker1, Marker2)> for F
where F: ReflectFn<'env, Marker1> + TypedFunction<Marker2> + Send + Sync + 'env,