Struct objc2::declare::IvarDrop

source ·
pub struct IvarDrop<T> { /* private fields */ }
Expand description

A helper type to allow putting certain types that may drop into ivars.

This is used to work around current limitations in the type system. Consider this type “temporary” in the sense that one day it may just become type IvarDrop<T> = T.

This currently works with the following types:

  • Box<T>
  • Option<Box<T>>
  • Id<T, O>
  • Option<Id<T, O>>

Further may be added when the standard library guarantees their layout.

See examples/delegate.rs for usage.

Trait Implementations§

source§

impl<T: Sized> InnerIvarType for IvarDrop<Box<T>>

§

type Output = Box<T, Global>

The type that an Ivar containing this will dereference to. Read more
source§

impl<T: Message, O: Ownership> InnerIvarType for IvarDrop<Id<T, O>>

§

type Output = Id<T, O>

The type that an Ivar containing this will dereference to. Read more
source§

impl<T: Sized> InnerIvarType for IvarDrop<Option<Box<T>>>

§

type Output = Option<Box<T, Global>>

The type that an Ivar containing this will dereference to. Read more
source§

impl<T: Message, O: Ownership> InnerIvarType for IvarDrop<Option<Id<T, O>>>

§

type Output = Option<Id<T, O>>

The type that an Ivar containing this will dereference to. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for IvarDrop<T>where T: RefUnwindSafe,

§

impl<T> Send for IvarDrop<T>where T: Send,

§

impl<T> Sync for IvarDrop<T>where T: Sync,

§

impl<T> Unpin for IvarDrop<T>where T: Unpin,

§

impl<T> UnwindSafe for IvarDrop<T>where 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<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> AutoreleaseSafe for Twhere T: ?Sized,