uniffi-rs icon indicating copy to clipboard operation
uniffi-rs copied to clipboard

static method support

Open chenzww opened this issue 4 years ago • 4 comments

It seems that, uniffi-rs does not to support static method/associated function yet.

┆Issue is synchronized with this Jira Task ┆Issue Number: UNIFFI-100

chenzww avatar Oct 17 '21 06:10 chenzww

Hey, is there a consensus on this from the maintainers? I’d be willing to look into this.

ernestask avatar Jun 19 '23 13:06 ernestask

I don't know if any of the maintainers have thought this through as the need hasn't come up in our use-cases. I suspect the answer will depend on the implementation - ie, how much complexity/overhead it adds vs the current scenario of just using namespace functions.

mhammond avatar Jun 19 '23 14:06 mhammond

Given that constructors are implemented through class/static/whatever methods and that Web IDL does have a concept of static operations, maybe there wouldn’t be a lot of novel code.

ernestask avatar Jun 19 '23 14:06 ernestask

I vote for this. It would be great if I could use #[uniffi::export] attribute on static methods.

conanoc avatar Sep 07 '23 06:09 conanoc