dfinity / cdk-rs

Rust canister development kit for the Internet Computer.
Apache License 2.0
202 stars 88 forks source link

feat: Implement closure-based http transform API #385

Closed adamspofford-dfinity closed 1 year ago

adamspofford-dfinity commented 1 year ago

The existing HTTP outcall transfrom API uses std::any::type_name in the specific way that it says not to, and which is not guaranteed to keep working. This PR changes it to a different system where a closure is used based on the context, rather than requiring the context to be interpreted directly. An optional feature is used for the new API as it requires exporting a canister method. Manual testing was performed to ensure there were no memory leaks.

Is there a better name for these functions?