the.bay.news

How to represent function with lifetime parameters in trait bounds?

The Rust Programming Language Forum
How to represent function with lifetime parameters in trait bounds?
I have a trait (we'll call it WrapFn) that is being implemented for all functions whose parameters satisfy FromValue<'a> and return types satisfy IntoValue<'a>. The point of this trait is to convert a function with complex types, e.g. // using f64::sin as an example fn sin(x: f64) -> f64; into a generic function which takes a Value<'a> and returns a Value<'a>. The only method of WrapFn is wrap_fn(self) -> FnWrapper<impl for<'a> Fn(Value<'a>) -> Value<'a>>. Currently, the implementation looks ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.