Skip to content

Use parameter object types from C++ side #1657

@Nugine

Description

@Nugine

It's common to use parameter objects in C++ libraries.

struct Options {
  std::string a;
  uint64_t b;
  int32_t *c;
  // ...
}

int foo(const Options& options);

The parameter objects are usually trivially-relocatable struct types.
How to use them in Rust side without repeating their defintions?

  • construction and destruction
  • field access
  • passing to C++ functions

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