You've already forked comprehensive-rust
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:
22
third_party/cxx/book/snippets.rs
vendored
22
third_party/cxx/book/snippets.rs
vendored
@ -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
|
Reference in New Issue
Block a user