Enum cxx::kind::Opaque

source ·
pub enum Opaque {}
Expand description

An opaque type which cannot be passed or held by value within Rust.

Rust’s move semantics are such that every move is equivalent to a memcpy. This is incompatible in general with C++’s constructor-based move semantics, so a C++ type which has a destructor or nontrivial move constructor must never exist by value in Rust. In CXX, such types are called opaque C++ types.

When passed across an FFI boundary, an opaque C++ type must be behind an indirection such as a reference or UniquePtr.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.