Skip to content

Make blocks with encoding easier to use #651

Open
@madsmtm

Description

@madsmtm

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-block2Affects the `block2` crateenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions