Skip to content

hide type detail when using type alias? #711

Description

@myrfy001

For the following rust code, with command cbindgen --lang C t.rs

type Context = HashMap<String, String>;

#[no_mangle]
pub extern fn new_context() -> *const Context{}

will generate the following C code:

typedef struct HashMap_String__String HashMap_String__String;

typedef struct HashMap_String__String Context;

const Context *new_context(void);

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions