Skip to main content

DefaultBox

Trait DefaultBox 

Source
pub trait DefaultBox {
    // Required method
    fn default_box() -> Box<Self>;
}
Expand description

Allows creating a default box of a type.

Required Methods§

Source

fn default_box() -> Box<Self>

Creates a reasonable default box of this type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: ?Sized> DefaultBox for T
where Box<T>: Default,