Trait DefaultRef

Source
pub trait DefaultRef {
    // Required method
    fn default_ref<'a>() -> &'a Self;
}
Expand description

Allows creating a default reference to a type.

Required Methods§

Source

fn default_ref<'a>() -> &'a Self

Creates a reasonable default reference for this type.

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§

Source§

impl<T: ?Sized> DefaultRef for T
where for<'a> &'a T: Default,