Trait enso_prelude::ToRef[][src]

pub trait ToRef<T> where
    T: ?Sized
{ fn to_ref(&self) -> &T; }
Expand description

Similar to AsRef but more specific and automatically implemented for every type. Allows for conversion &T to &T (identity) and T to &T for any type T. In contrast, AsRef requires explicit impls, so for example you cannot do let t:&() = ().as_ref()

Required methods

fn to_ref(&self) -> &T[src]

Implementations on Foreign Types

impl<T> ToRef<T> for &T where
    T: ?Sized
[src]

fn to_ref(&self) -> &T[src]

Implementors

impl<T> ToRef<T> for T where
    T: ?Sized
[src]

fn to_ref(&self) -> &T[src]