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

Make blocks with encoding easier to use #651

Open
madsmtm opened this issue Sep 17, 2024 · 0 comments
Open

Make blocks with encoding easier to use #651

madsmtm opened this issue Sep 17, 2024 · 0 comments
Labels
A-block2 Affects the `block2` crate enhancement New feature or request

Comments

@madsmtm
Copy link
Owner

madsmtm commented Sep 17, 2024

#636 added [Rc|Stack]Block::with_encoding, but they're pretty cumbersome to use because you have to create a helper structure, and implement ManualBlockEncoding with the correct encoding.

What's the solution when something is cumbersome? Make it automatic!

An idea would be to write a script that uses libclang, goes through all Apple's headers, on a few different targets, and generates the correct ManualBlockEncoding for the corresponding fn(A) -> Rs. That way

This would allow the user to write RcBlock::with_encoding<fn(i32) -> i32, _, _>(|x| x * x) in the vast majority of cases.

CC @PaulDance

@madsmtm madsmtm added enhancement New feature or request A-block2 Affects the `block2` crate labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-block2 Affects the `block2` crate enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant