Trait AsSafView

Source
pub trait AsSafView<const N: usize>: for<'a> Lifetime<'a, Item = SafView<'a, N>> {
    // Required method
    fn as_saf_view(&self) -> <Self as Lifetime<'_>>::Item;
}
Expand description

A type that can be cheaply converted to a SAF view.

This is akin to GATified AsRef for SAF views.

Required Methods§

Source

fn as_saf_view(&self) -> <Self as Lifetime<'_>>::Item

Returns a SAF view of self.

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.

Implementors§

Source§

impl<'a, const N: usize> AsSafView<N> for &'a Saf<N>

Source§

impl<'a, const N: usize> AsSafView<N> for SafView<'a, N>

Source§

impl<const N: usize> AsSafView<N> for Saf<N>