Crate autocxx_engine

Source
Expand description

The core of the autocxx engine, used by both the autocxx_macro and also code generators (e.g. autocxx_build). See IncludeCppEngine for general description of how this engine works.

Structs§

AutocxxgenHeaderNamer
Function to generate the desired name of the header containing autocxx’s extra generated C++. Newtype wrapper so we can give it a Default.
Builder
An object to allow building of bindings from a build.rs file.
BuilderSuccess
For test purposes only, a cc::Build and lists of Rust and C++ files generated.
CodegenOptions
Code generation options.
CppCodegenOptions
Options for C++ codegen
CppFilePair
Some C++ content which should be written to disk and built.
CxxgenHeaderNamer
Function to generate the desired name of the header containing cxx’s declarations. Newtype wrapper so we can give it a Default.
GeneratedCpp
All generated C++ content which should be written to disk.
IncludeCppEngine
Core of the autocxx engine.
LocatedSynError
A syn::Error which also implements miette::Diagnostic so can be pretty-printed to show the affected span of code.
ParsedFile
A Rust file parsed by autocxx. May contain zero or more autocxx ‘engines’, i.e. the IncludeCpp class, corresponding to zero or more include_cpp macros within this file. Also contains syn::Item structures for all the rest of the Rust code, such that it can be reconstituted if necessary.
RsOutput
Opaque structure representing the Rust which needs to be generated for a given include_cpp! macro. You will want to pass this into either generate_rs_single or generate_rs_archive.

Enums§

BuilderError
Errors returned during creation of a cc::Build from an include_cxx macro.
Error
Errors which may occur in generating bindings for these C++ functions.
ParseError
Errors which may occur when parsing a Rust source file to discover and interpret include_cxx macros.

Statics§

HEADER
The complete contents of the “rust/cxx.h” header.

Traits§

BuilderContext
The context in which a builder object lives. Callbacks for various purposes.
RebuildDependencyRecorder
Implement to learn of header files which get included by this build process, such that your build system can choose to rerun the build process if any such file changes in future.

Functions§

do_cxx_cpp_generation
generate_rs_archive
Creates an on-disk archive (actually a JSON file) of the Rust side of the bindings for multiple include_cpp macros. If you use this, you will want to tell autocxx_macro how to find this file using the AUTOCXX_RS_JSON_ARCHIVE environment variable.
generate_rs_single
Gets the Rust code corresponding to a single RsOutput. You can write this to a file which can simply be include!ed by autocxx_macro when you give it the AUTOCXX_RS_FILE environment variable.
get_clang_path
Get the path to clang which is effective for any preprocessing operations done by autocxx.
get_cxx_header_bytes
make_clang_args
Get clang args as if we were operating clang the same way as we operate bindgen.
parse_file
Parse a Rust file, and spot any include_cpp macros within it.
preprocess
Preprocess a file using the same options as is used by autocxx. Input: listing_path, output: preprocess_path.

Type Aliases§

BuilderBuild
BuilderResult
Results of a build.
Result
Result type.