Trait Reference

Source
pub trait Reference: Primitive + Sized {
    // Required method
    fn as_ref(&self) -> &Self;
}

Required Methods§

Source

fn as_ref(&self) -> &Self

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.

Implementations on Foreign Types§

Source§

impl<T: ?Sized> Reference for &T

Source§

fn as_ref(&self) -> &Self

Source§

impl<T: ?Sized> Reference for &mut T

Source§

fn as_ref(&self) -> &Self

Implementors§