54 releases

0.27.0 Jun 25, 2024
0.26.0 Jun 16, 2023
0.25.0 Mar 9, 2023
0.23.1 Nov 8, 2022
0.4.0 Nov 10, 2020

#18 in FFI

Download history 2930/week @ 2024-07-09 2652/week @ 2024-07-16 2184/week @ 2024-07-23 2257/week @ 2024-07-30 2303/week @ 2024-08-06 2730/week @ 2024-08-13 3330/week @ 2024-08-20 3846/week @ 2024-08-27 2456/week @ 2024-09-03 2519/week @ 2024-09-10 1893/week @ 2024-09-17 3208/week @ 2024-09-24 2504/week @ 2024-10-01 2336/week @ 2024-10-08 2741/week @ 2024-10-15 3397/week @ 2024-10-22

11,616 downloads per month
Used in 37 crates (25 directly)

MIT/Apache

89KB
967 lines

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.

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Dependencies

~2.6–5MB
~104K SLoC