Skip to main content

Reference

Trait Reference 

Source
pub trait Reference<T: ?Sized>: Primitive + Sized {
    // Required methods
    fn ref_type() -> Mutability;
    fn as_ref(&self) -> &Self;
}

Required Methods§

Source

fn ref_type() -> Mutability

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<T> for &T

Source§

fn ref_type() -> Mutability

Source§

fn as_ref(&self) -> &Self

Source§

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

Source§

fn ref_type() -> Mutability

Source§

fn as_ref(&self) -> &Self

Implementors§