pub trait AsBytesExt: AsBytes + NoCell + Sized {
    // Provided method
    fn as_bytes_ref(&self) -> Ref<&[u8], Self> { ... }
}

Provided Methods§

source

fn as_bytes_ref(&self) -> Ref<&[u8], Self>

Gets a byte slice reference from a reference to Self.

This is essentially the reverse of Ref constructors and can be used to construct Ref fields in zerocopy types from a reference to Self instead of bytes.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> AsBytesExt for T
where T: AsBytes + NoCell + Sized,