Skip to content

An export! macro wishlist #14

@emk

Description

@emk

Wow, what a great idea for a crate! I just used this to massively simplify some neon bindings at work. I especially like the export! macro.

While working on this, I wrote a wishlist for enhancements to the export! macro. And yes, I may be able to find some time to work on some of these if you're interested. :-)

  • Optional arguments. It would be great if we could write Option<Foo>, and have that translate to get rather than require.
  • Functions which return Result values. Ideally, I should be able to return any type implementing Error, and have it converted to a Throw result. But this raises the question: Should all exported functions return Result?
  • Rust doc comment support. I should be able to document exported methods with /// without getting an error. This is an easy fix.
  • Automatic #[allow(non_snake_case)] so that exported functions can be given idiomatic JavaScript names.
  • A documentation example showing how to use serde_bytes::ByteBuf to handle JsBuffer values.

Do any of these features interest you? Would you be willing to consider a PR if I prepared one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions