Trait BoxExt

Source
pub trait BoxExt: Sized {
    type T: ?Sized;

    // Required methods
    fn drop_box(bx: Self) -> UninitBox;
    fn take_box(bx: Self) -> (UninitBox, Self::T)
       where Self::T: Sized;
}
Expand description

Extension methods for Box<T>

Required Associated Types§

Source

type T: ?Sized

The type that the Box<T> stores

Required Methods§

Source

fn drop_box(bx: Self) -> UninitBox

drops the value inside the box and returns the allocation in the form of an UninitBox

Source

fn take_box(bx: Self) -> (UninitBox, Self::T)
where Self::T: Sized,

takes the value inside the box and returns it as well as the allocation in the form of an UninitBox

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: ?Sized> BoxExt for Box<T>

Source§

type T = T

Source§

fn drop_box(bx: Self) -> UninitBox

Source§

fn take_box(bx: Self) -> (UninitBox, Self::T)
where Self::T: Sized,

Implementors§