Squashed 'third_party/autocxx/' content from commit 629e8fa53

git-subtree-dir: third_party/autocxx
git-subtree-split: 629e8fa531a633164c0b52e2a3cab536d4cd0849
Signed-off-by: Brian Silverman <bsilver16384@gmail.com>
Change-Id: I62a03b0049f49adf029e0204639cdb5468dde1a1
189 files changed
tree: 7dac9f614e65e4c234c3c3b026a4b510b8a08cd4
  1. .github/
  2. book/
  3. demo/
  4. engine/
  5. examples/
  6. gen/
  7. integration-tests/
  8. macro/
  9. parser/
  10. src/
  11. tools/
  12. .gitignore
  13. .gitmodules
  14. Cargo.lock
  15. Cargo.toml
  16. LICENSE-APACHE
  17. LICENSE-MIT
  18. README.md
README.md

Autocxx

GitHub crates.io docs.rs

This project is a tool for calling C++ from Rust in a heavily automated, but safe, fashion.

The intention is that it has all the fluent safety from cxx whilst generating interfaces automatically from existing C++ headers using a variant of bindgen. Think of autocxx as glue which plugs bindgen into cxx.

For full documentation, see the manual.

Overview

autocxx::include_cpp! {
    #include "url/origin.h"
    generate!("url::Origin")
    safety!(unsafe_ffi)
}

fn main() {
    let o = ffi::url::Origin::CreateFromNormalizedTuple("https",
        "google.com", 443);
    let uri = o.Serialize();
    println!("URI is {}", uri.to_str().unwrap());
}

License and usage notes

This is not an officially supported Google product.