Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support async functions in rust #69

Open
ecton opened this issue Apr 30, 2020 · 0 comments
Open

[Feature] Support async functions in rust #69

ecton opened this issue Apr 30, 2020 · 0 comments

Comments

@ecton
Copy link

ecton commented Apr 30, 2020

I am implementing a UI layer in an async framework, and I am unable to pass Stretch around (including using it as a member on the "self" structure) in async code because MeasureFunc is not Send/Sync.

Boxed(sys::Box<dyn Fn(Size<Number>) -> Size<f32>>),

I believe that the change may be as simple as changing the type of Boxed's value to sys::Box<dyn Fn(Size<Number>) -> Size<f32>> + Send + Sync)

This, unfortunately, could be a breaking change since this is a publicly exposed enum, so before jumping in to create a PR, I wanted to see what the opinion would be of attempting this change. I'm new enough to understanding how async works that I am not sure what the likelihood that these functions in most codebase wouldn't already be Send + Sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant