docs(eventhubs): add C++ FFI interop guide#4614
Draft
j7nw4r wants to merge 1 commit into
Draft
Conversation
fc1daad to
9ff9c76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
sdk/eventhubs/azure_messaging_eventhubs/docs/cpp_interop.md, a reference guide for consuming the Rust Event Hubs SDK from a modern C++ (C++20) application through a Rustextern "C"FFI shim.Motivation
azure_messaging_eventhubsis a pure-Rust crate with an async API and no C ABI, so it cannot be linked from C++ directly. There was no documentation describing the FFI path. The guide fills that gap and serves as a template for building such a shim.Changes
open/send_event/close), consumer, and receiver paths against the real crate API, including a process-wide Tokio runtime, opaque handles, anerrno-style thread-local error channel, andcatch_unwindpanic guards.stream_events(&self)borrows the receiver) and a sound resolution via boxing plus struct field drop order, withouroboros/self_cellnoted as safe alternatives.unique_ptrRAII handles, status-codes-to-exceptions,std::string_viewin andstd::span<const std::byte>out.Documentation only; no code or build changes.