Skip to main content

DefaultOwned

Trait DefaultOwned 

Source
pub trait DefaultOwned: ToOwned {
    // Required method
    fn default_owned() -> <Self as ToOwned>::Owned;
}
Expand description

Allows creating a default owned version of a type.

Required Methods§

Source

fn default_owned() -> <Self as ToOwned>::Owned

Creates a reasonable, owned default 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<O: Default + Borrow<T>, T: ?Sized + ToOwned<Owned = O>> DefaultOwned for T