Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework raw operator API on top of safer-api crate Allows a higher-level interface #76

Merged
merged 13 commits into from
Sep 7, 2022

Conversation

phil-opp
Copy link
Collaborator

@phil-opp phil-opp commented Aug 25, 2022

Use the safer-ffi crate to define a higher-level operator API.

The foundation of the new API is a new dora-operator-api-types crate, which defines C-compatible types for inputs, outputs, and the different functions. These types are then used by both the dora-operator-api and runtime crates. This way, we can prevent undefined behavior caused by mismatched types. To also prevent type mismatch problems in the C-API, we now autogenerate a operator_types.h header file based on the types crate.

This change will make it much easier to add additional metadata to inputs and outputs.

Allows a higher-level interface
…safer-ffi`

Requires removing the lifetime of the `SendOutput` type. We now use a `'static` Arc-owned closure instead.

To make sure that all types show up in the C header files that we'll generate, we make sure that all the top-level types use `#[repr(C)]` instead of `#[repr(transparent)]`.
Copy link
Collaborator

@haixuanTao haixuanTao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Looks great! Love that we will have an Error string from C Operators!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants