#[repr(C)]
pub struct CGlueObjContainer<T, C, R> { /* private fields */ }
Expand description

Simple CGlue trait object container.

This is the simplest form of container, represented by an instance, clone context, and temporary return context.

instance value usually is either a reference, or a mutable reference, or a CBox, which contains static reference to the instance, and a dedicated drop function for freeing resources.

context is either PhantomData representing nothing, or typically a CArc that can be cloned at will, reference counting some resource, like a Library for automatic unloading.

ret_tmp is usually PhantomData representing nothing, unless the trait has functions that return references to associated types, in which case space is reserved for wrapping structures.

Trait Implementations§

source§

impl<T: Deref<Target = F>, F, C: ContextBounds, R> CGlueObjBase for CGlueObjContainer<T, C, R>

§

type ObjType = F

Type of the underlying object.
§

type InstType = T

Type of the container housing the object.
§

type Context = C

Type of the context associated with the container.
source§

fn cobj_base_ref(&self) -> (&F, &Self::Context)

source§

fn cobj_base_owned(self) -> (T, Self::Context)

source§

impl<T: Deref<Target = F> + DerefMut, F, C: ContextBounds, R> CGlueObjMut<R> for CGlueObjContainer<T, C, R>

source§

fn cobj_mut(&mut self) -> (&mut F, &mut R, &Self::Context)

source§

impl<T: Deref<Target = F>, F, C: ContextBounds, R> CGlueObjRef<R> for CGlueObjContainer<T, C, R>

source§

fn cobj_ref(&self) -> (&F, &R, &Self::Context)

source§

impl<'a, T, C: ContextBounds, R: Default> From<(T, C)> for CGlueObjContainer<CBox<'a, T>, C, R>

source§

fn from((this, context): (T, C)) -> Self

Converts to this type from the input type.
source§

impl<T: Deref<Target = F>, F, C: ContextBounds, R: Default> From<(T, C)> for CGlueObjContainer<T, C, R>

source§

fn from((instance, context): (T, C)) -> Self

Converts to this type from the input type.
source§

impl<'a, T: Deref<Target = F>, F, V: CGlueVtbl<CGlueObjContainer<T, C, R>, Context = C, RetTmp = R>, C: ContextBounds, R: Default> From<CGlueObjContainer<T, C, R>> for CGlueTraitObj<'a, T, V, V::Context, V::RetTmp>where &'a V: Default,

source§

fn from(container: CGlueObjContainer<T, C, R>) -> Self

Converts to this type from the input type.
source§

impl<'a, T, R: Default> From<T> for CGlueObjContainer<CBox<'a, T>, NoContext, R>

source§

fn from(this: T) -> Self

Converts to this type from the input type.
source§

impl<T: Deref<Target = F>, F, R: Default> From<T> for CGlueObjContainer<T, NoContext, R>

source§

fn from(this: T) -> Self

Converts to this type from the input type.
source§

impl<T: Opaquable, C, R> Opaquable for CGlueObjContainer<T, C, R>

§

type OpaqueTarget = CGlueObjContainer<<T as Opaquable>::OpaqueTarget, C, R>

source§

fn into_opaque(self) -> Self::OpaqueTarget

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

Auto Trait Implementations§

§

impl<T, C, R> RefUnwindSafe for CGlueObjContainer<T, C, R>where C: RefUnwindSafe, R: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, C, R> Send for CGlueObjContainer<T, C, R>where C: Send, R: Send, T: Send,

§

impl<T, C, R> Sync for CGlueObjContainer<T, C, R>where C: Sync, R: Sync, T: Sync,

§

impl<T, C, R> Unpin for CGlueObjContainer<T, C, R>where C: Unpin, R: Unpin, T: Unpin,

§

impl<T, C, R> UnwindSafe for CGlueObjContainer<T, C, R>where C: UnwindSafe, R: UnwindSafe, T: UnwindSafe,

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> 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>,