Enum Opaque

pub enum Opaque

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

impl Kind for Opaque

Auto Trait Implementations

impl Freeze for Opaque

impl RefUnwindSafe for Opaque

impl Send for Opaque

impl Sync for Opaque

impl Unpin for Opaque

impl UnsafeUnpin for Opaque

impl UnwindSafe for Opaque

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for Opaque

fn from(t: T) -> T

Returns the argument unchanged.

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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