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

Namespacing entities in generated bindings

Open threema-lenny opened this issue 1 year ago • 1 comments

Right now, at least when using proc macros, all entities are mangled into the same namespace in the generated bindings, even if they come from totally different modules in the source. This gets messy quickly when having lots of functions. Is there a plan to respect modules or e.g. customise the namespace of an exported binding with a macro?

threema-lenny avatar Nov 15 '23 17:11 threema-lenny

Yeah, the foreign namespace is currently flat for a given crate. I'm not aware of any plans, so I think we'd welcome proposals, but I suspect there's not going to be an easy story to be told here. cross-crate module namespaces should work OK, and IMO that's more important and has the added advantage of encouraging smaller more module crates.

mhammond avatar Nov 15 '23 19:11 mhammond