pub trait IntoFunction<'env, Marker> {
// Required method
fn into_function(self) -> DynamicFunction<'env>;
}
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§
Sourcefn into_function(self) -> DynamicFunction<'env>
fn into_function(self) -> DynamicFunction<'env>
Converts Self
into a DynamicFunction
.