You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't want to let the enduser know the detail of Context is a HashMap_String__String, they should only know it's a type of Context, how can I do that?
Thanks
The text was updated successfully, but these errors were encountered:
Technically, newtypes are not guaranteed to have the same memory layout as their inner types, see rust-lang/rust#87868 (comment).
I would want to put repr(transparent) on that Context so Rust compiler doesn't do anything funny. But adding it would make struct transparent to cbindgen as well.
@emilio is there a way to tell cbindgen to ignore repr(transparent) or repr(C) directives, and make the struct opaque instead? I was looking for something like /// cbindgen:opaque annotation, but nothing like this seem to exist at the moment.
For the following rust code, with command
cbindgen --lang C t.rs
will generate the following C code:
I don't want to let the enduser know the detail of
Context
is aHashMap_String__String
, they should only know it's a type ofContext
, how can I do that?Thanks
The text was updated successfully, but these errors were encountered: