Skip to main content

DefaultRef

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".

Implementors§

Source§

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