deferred-reference 0.1.2

A deferred reference is not an actual reference, it is merely a smart pointer tied to the lifetime of the location it points to.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::PointerLength;

/// This trait is implemented for all slice-like structures. Currently there are only 2 of these types: arrays `[T; N]` and slices `[T]`.
pub trait SliceLike: PointerLength {
    /// The type of the elements held by the slice-like structure.
    type Element;
}

impl<T> SliceLike for [T] {
    type Element = T;
}

impl<T, const N: usize> SliceLike for [T; N] {
    type Element = T;
}