Skip to main content

IntoRef

Trait IntoRef 

Source
pub trait IntoRef<'a>: 'a {
    type Out: ?Sized;

    // Required method
    fn into_ref(self) -> &'a Self::Out;
}
Expand description

Consume self into reference

Required Associated Types§

Required Methods§

Source

fn into_ref(self) -> &'a Self::Out

Consume self into reference

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, P> IntoRef<'a> for Pin<P>
where P: Deref + IntoRef<'a>, P::Target: Unpin,

Source§

type Out = <P as IntoRef<'a>>::Out

Source§

fn into_ref(self) -> &'a Self::Out

Source§

impl<'a, T: ?Sized> IntoRef<'a> for &'a T

Source§

type Out = T

Source§

fn into_ref(self) -> &'a Self::Out

Source§

impl<'a, T: ?Sized> IntoRef<'a> for &'a mut T

Source§

type Out = T

Source§

fn into_ref(self) -> &'a Self::Out

Implementors§