Trait Ref

Source
pub trait Ref<'a, T> {
    // Required method
    fn convert(val: &'a T) -> Self;
}
Expand description

Marker that states that Self can be obtained from the reference &'a T.

Required Methods§

Source

fn convert(val: &'a T) -> Self

Performs the conversion, showing that it is possible.

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<'a, K, V> Ref<'a, (K, V)> for (&'a K, &'a V)

Source§

fn convert(val: &'a (K, V)) -> (&'a K, &'a V)

Source§

impl<'a, K: Copy, V> Ref<'a, (K, V)> for (K, &'a V)

Source§

fn convert(val: &'a (K, V)) -> (K, &'a V)

Source§

impl<'a, T> Ref<'a, T> for &'a T

Implementors§

Source§

impl<'a, T: Copy> Ref<'a, T> for T