Struct cglue::boxed::CBox

source ·
#[repr(C)]
pub struct CBox<'a, T: 'a> { /* private fields */ }
Expand description

FFI-safe box

This box has a static self reference, alongside a custom drop function.

The drop function can be called from anywhere, it will free on correct allocator internally.

Trait Implementations§

source§

impl<T> Deref for CBox<'_, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T> DerefMut for CBox<'_, T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<T> Drop for CBox<'_, T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T> From<(T, PhantomData<c_void>)> for CBox<'_, T>

source§

fn from((this, _): (T, NoContext)) -> Self

Converts to this type from the input type.
source§

impl<T> From<Box<T>> for CBox<'_, T>

source§

fn from(this: Box<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<T> for CBox<'_, T>

source§

fn from(this: T) -> Self

Converts to this type from the input type.
source§

impl<T> IntoInner for CBox<'_, T>

§

type InnerTarget = T

source§

unsafe fn into_inner(self) -> Self::InnerTarget

Consume self and return inner type. Read more
source§

impl<'a, T> Opaquable for CBox<'a, T>

§

type OpaqueTarget = CBox<'a, c_void>

source§

fn into_opaque(self) -> Self::OpaqueTarget

Transform self into an opaque version of the trait object. Read more

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for CBox<'a, T>where T: RefUnwindSafe,

§

impl<'a, T> Send for CBox<'a, T>where T: Send,

§

impl<'a, T> Sync for CBox<'a, T>where T: Sync,

§

impl<'a, T> Unpin for CBox<'a, T>

§

impl<'a, T> !UnwindSafe for CBox<'a, T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> Forward for Twhere T: Deref,

source§

fn forward(self) -> Fwd<Self>

source§

impl<T> ForwardMut for Twhere T: DerefMut,

source§

fn forward_mut(self) -> Fwd<Self>

source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, F> From2<T> for Fwhere T: Into<F>,

source§

fn from2(other: T) -> F

source§

impl<T, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> GenericTypeBounds for T

source§

impl<T> Opaque for Twhere T: Opaquable<OpaqueTarget = T>,