tree: 3577e46799f7d22a266979628a92ab526e7c439f [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. build.rs
  16. Cargo.lock
  17. Cargo.toml
  18. LICENSE-APACHE
  19. LICENSE-MIT
  20. 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.