tree: 894f83b00bdedd92e2fc111c64577e1c839a32ad [path history] [tgz]
  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. BUILD
  15. Cargo.lock
  16. Cargo.toml
  17. LICENSE-APACHE
  18. LICENSE-MIT
  19. README.md
third_party/autocxx/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.