Stop doing Rust-side wrappers around fastly crate

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, rust

Research direction

Start by locating the main fastly Rust crate, its ffi definitions, and the existing owned wrappers used by the C++ SDK. Trace how cxx trait implementations and custom conversions or static methods depend on those wrappers; done means ffi is defined in the main crate while only necessary custom wrappers remain.

Written by the indexing model from the issue text.

Description

technical improvement

We currently manually wrap every single Rust type with an additional, owned wrapper. This was a nice and quick solution that allowed the cpp sdk to exist independently of the main fastly SDK. Unfortunately, this means that we can't do certain things, like return references to fastly objects. It also adds some potential overhead.

Ideally, we would define the ffi stuff directly in the main fastly Rust crate, so cxx can apply its trait implementations to the original types. We'll still need custom wrappers around many things for the custom type conversions, static methods, etc, though.

Dominant language
C++
Stars
9
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fastly/compute-sdk-cpp

All issues in fastly/compute-sdk-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.