Daxa icon indicating copy to clipboard operation
Daxa copied to clipboard

rust api

Open Ipotrick opened this issue 1 year ago • 0 comments

We need...

Rust side types:

  • [ ] FixedlList
  • [ ] SmallString
  • [ ] Optional
  • [ ] Variant These types are our c api compatibility types. These c types should have a mirror type in rust just like in c++ (look at types.hpp). These types should be apbi compatible, meaning a simple transmute should always be enough to cast between them.

Refcounting Handles:

  • the c api already provides refcounting functions.
  • [ ] implement rust generic implementing the refcounting using the c functions
  • [ ] implement wrapper functions for all the refcounted handles

Functions:

  • not all functions info struct need to be abi compatible, use new types when convenient
  • the Info structs should ALWAYS be abi compatible, never translate these types, a reinterpret cast of the reference should be enough
  • orient yourself on the c and c++ api
  • all c functions that may return errors should return a rust error enum

Ipotrick avatar Nov 05 '23 11:11 Ipotrick