1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-17 06:37:34 +02:00

Add Chromium section (#1479)

This is a contribution of a Chromium section for Comprehensive Rust.

---------

Co-authored-by: Nicole L <dlegare.1001@gmail.com>
Co-authored-by: Martin Geisler <martin@geisler.net>
This commit is contained in:
Adrian Taylor
2023-11-27 18:21:19 +00:00
committed by GitHub
parent 5a7b4d568b
commit 7f469fb2c7
37 changed files with 960 additions and 1 deletions

View File

@ -119,3 +119,25 @@ fn main() {
}
}
// ANCHOR_END: cpp_exception
// ANCHOR: cxx_overview
#[cxx::bridge]
mod ffi {
extern "Rust" {
type MultiBuf;
fn next_chunk(buf: &mut MultiBuf) -> &[u8];
}
unsafe extern "C++" {
include!("example/include/blobstore.h");
type BlobstoreClient;
fn new_blobstore_client() -> UniquePtr<BlobstoreClient>;
fn put(self: &BlobstoreClient, buf: &mut MultiBuf) -> Result<u64>;
}
}
// Definitions of Rust types and functions go here
// ANCHOR_END: cxx_overview