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
Open
@kjvalencik

Description

@kjvalencik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0