pub trait BoxAssumeInit: Sealed {
    type Ret: ?Sized;

    // Required method
    unsafe fn assume_init(self) -> Box<Self::Ret>;
}
Available on crate features alloc or std only.
Expand description

Extension trait to .assume_init() through a Box.

This is a compatibility helper trait. For versions of Rust where the feature(box_uninit) is unstable, this trait enables the feature in stable Rust. This may trigger an unstable_name_collisions lint, but this is fine, since the implementation is the same. You can dismiss that lint with:

#![allow(unstable_name_collisions)]

Required Associated Types§

Required Methods§

source

unsafe fn assume_init(self) -> Box<Self::Ret>

Implementations on Foreign Types§

source§

impl<T> BoxAssumeInit for Box<MaybeUninit<T>>

source§

unsafe fn assume_init(self: Box<MaybeUninit<T>>) -> Box<T>

Allows to “.assume_init()” a boxed MaybeUninit<T>.

Safety
§

type Ret = T

source§

impl<T> BoxAssumeInit for Box<[MaybeUninit<T>]>

source§

unsafe fn assume_init(self: Box<[MaybeUninit<T>]>) -> Box<[T]>

Allows to “.assume_init()” a boxed [MaybeUninit<T>].

Safety
§

type Ret = [T]

Implementors§