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.
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
ffistuff directly in the mainfastlyRust crate, socxxcan 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.