Trait der::referenced::OwnedToRef

source ·
pub trait OwnedToRef {
    type Borrowed<'a>
       where Self: 'a;

    // Required method
    fn owned_to_ref(&self) -> Self::Borrowed<'_>;
}
Expand description

A trait for borrowing data from an owned struct

Required Associated Types§

source

type Borrowed<'a> where Self: 'a

The resulting type referencing back to Self

Required Methods§

source

fn owned_to_ref(&self) -> Self::Borrowed<'_>

Creates a new object referencing back to the self for storage

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl OwnedToRef for Box<[u8]>

§

type Borrowed<'a> = &'a [u8]

source§

fn owned_to_ref(&self) -> Self::Borrowed<'_>

source§

impl<T> OwnedToRef for Option<T>
where T: OwnedToRef,

§

type Borrowed<'a> = Option<<T as OwnedToRef>::Borrowed<'a>> where T: 'a

source§

fn owned_to_ref(&self) -> Self::Borrowed<'_>

Implementors§