TryDefault

Trait TryDefault 

Source
pub trait TryDefault: Sized {
    type Error;

    // Required method
    fn try_default() -> Result<Self, Self::Error>;
}
Expand description

The try trait for Default.

Required Associated Types§

Source

type Error

The type returned in the event of an error.

Required Methods§

Source

fn try_default() -> Result<Self, Self::Error>

The fallible equivalent of Default::default.

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.

Implementors§