Struct CppCodegenOptions

Source
pub struct CppCodegenOptions<'a> {
    pub suppress_system_headers: bool,
    pub path_to_cxx_h: Option<String>,
    pub path_to_cxxgen_h: Option<String>,
    pub autocxxgen_header_namer: AutocxxgenHeaderNamer<'a>,
    pub cxxgen_header_namer: CxxgenHeaderNamer<'a>,
    pub cxx_impl_annotations: Option<String>,
}
Expand description

Options for C++ codegen

Fields§

§suppress_system_headers: bool

Whether to avoid generating #include <some-system-header>. You may wish to do this to make a hermetic test case with no external dependencies.

§path_to_cxx_h: Option<String>

Optionally, a prefix to go at #include "*here*cxx.h". This is a header file from the cxx` crate.

§path_to_cxxgen_h: Option<String>

Optionally, a prefix to go at `#include “herecxxgen.h”. This is a header file which we generate.

§autocxxgen_header_namer: AutocxxgenHeaderNamer<'a>

Optionally, a function called to determine the name that will be used for the autocxxgen.h file. The function is passed the name of the module generated by each include_cpp, configured via name. These will be unique.

§cxxgen_header_namer: CxxgenHeaderNamer<'a>

A function to generate the name of the cxxgen.h header that should be output.

§cxx_impl_annotations: Option<String>

An annotation optionally to include on each C++ function. For example to export the symbol from a library.

Trait Implementations§

Source§

impl<'a> Default for CppCodegenOptions<'a>

Source§

fn default() -> CppCodegenOptions<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CppCodegenOptions<'a>

§

impl<'a> !RefUnwindSafe for CppCodegenOptions<'a>

§

impl<'a> !Send for CppCodegenOptions<'a>

§

impl<'a> !Sync for CppCodegenOptions<'a>

§

impl<'a> Unpin for CppCodegenOptions<'a>

§

impl<'a> !UnwindSafe for CppCodegenOptions<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.