8000 Pre-RFC: Procedural macro classes for N-API backend · Issue #37 · neon-bindings/rfcs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pre-RFC: Procedural macro classes for N-API backend #37

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

Open
kjvalencik opened this issue Dec 3, 2020 · 0 comments
Open

Pre-RFC: Procedural macro classes for N-API backend #37

kjvalencik opened this issue Dec 3, 2020 · 0 comments

Comments

@kjvalencik
Copy link
Member
kjvalencik commented Dec 3, 2020

Proc macro for classes

Replaces #6

Proc macros might allow creating classes as wrappers around the JsBox concept. For example:

struct MyClass {}

impl neon::JsClass for MyClass {
    fn init(cx: FunctionContext) -> Self { todo!() }
}

#[neon::class]
impl MyClass {
    #[neon::class_method(name = "myMethod")]
    my_method(cx: FunctionContext) -> Self {}
}

A use case to keep in my is re-using implementations. For example, a user might have both MemorySession and a RedisSession classes that share implementations. These should be friendly to generics and re-using the base class.

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
0