Struct core::any::TaggedOption
source · #[repr(transparent)]struct TaggedOption<'a, I: Type<'a>>(Option<I::Reified>);
Expand description
An Option
with a type tag I
.
Since this struct implements Erased
, the type can be erased to make a dynamically typed
option. The type can be checked dynamically using Erased::tag_id
and since this is statically
checked for the concrete type, there is some degree of type safety.
Tuple Fields§
§0: Option<I::Reified>
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a, I> Freeze for TaggedOption<'a, I>where <I as Type<'a>>::Reified: Freeze,
impl<'a, I> RefUnwindSafe for TaggedOption<'a, I>where <I as Type<'a>>::Reified: RefUnwindSafe,
impl<'a, I> Send for TaggedOption<'a, I>where <I as Type<'a>>::Reified: Send,
impl<'a, I> Sync for TaggedOption<'a, I>where <I as Type<'a>>::Reified: Sync,
impl<'a, I> Unpin for TaggedOption<'a, I>where <I as Type<'a>>::Reified: Unpin,
impl<'a, I> UnwindSafe for TaggedOption<'a, I>where <I as Type<'a>>::Reified: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more