[][src]Struct c_bridge::Opaque

#[repr(C)]
pub struct Opaque {
    pub dealloc: unsafe extern "C" fn(_: *mut Self),
    pub type_hint: unsafe extern "C" fn(_: *const Self) -> *const c_char,
    pub object: *mut c_void,
}

A FFI-compatible wrapper for opaque types

Fields

dealloc: unsafe extern "C" fn(_: *mut Self)

The deallocator

type_hint: unsafe extern "C" fn(_: *const Self) -> *const c_char

A pointer to a type hint (which is a NULL-terminated string)

object: *mut c_void

The underlying object (implementation dependent)

Methods

impl Opaque[src]

pub fn type_hint(&self) -> *const c_char[src]

The type hint of the opaque object

pub fn as_rust_box(&self) -> Option<&Box<dyn Any + 'static>>[src]

A reference to a Box<dyn Any + 'static> if the opaque object contains such a box

pub fn as_rust_box_mut(&mut self) -> Option<&mut Box<dyn Any + 'static>>[src]

A mutable reference to a Box<dyn Any + 'static> if the opaque object contains such a box

Trait Implementations

impl Drop for Opaque[src]

impl From<Box<dyn Any + 'static>> for Opaque[src]

Auto Trait Implementations

impl !Send for Opaque

impl !Sync for Opaque

impl Unpin for Opaque

impl UnwindSafe for Opaque

impl RefUnwindSafe for Opaque

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]