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

Figure Out How to Capture Variables in Closures #1

Open
seancarroll opened this issue Aug 1, 2022 · 0 comments
Open

Figure Out How to Capture Variables in Closures #1

seancarroll opened this issue Aug 1, 2022 · 0 comments

Comments

@seancarroll
Copy link
Owner

Currently this library is not very useful because control/candidates aka "behaviors" are typed as fn which does not allow them to the associated closures to capture closures which means you cant do much with them.

I've tried to switch over to FnOnce however since I'm keeping the behaviors in a vec I get compiler errors when attempting to iterate over candidates as a move occurs. I'm not yet sure how to structure the code yet to support the desired behavior. I feel like this would be similar to what Rust web frameworks(Actix, Hyper, Tower) do in regards to middleware but I do not yet comprehend how those work

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