Skip to main content

DefaultIsTripleUnderscore

Trait DefaultIsTripleUnderscore 

Source
pub trait DefaultIsTripleUnderscore: Default {
    // Provided method
    fn ___() -> Self { ... }
}
Expand description

Uniform syntax : MyStruct::___() instead of MyStruct::default()

Provided Methods§

Source

fn ___() -> Self

The Self::default() method.

Returns the “default value” for a type.

type T = i32; // any type with default
assert_eq!(T::default(), T::___());

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§