Skip to main content

IntoBytesExt

Trait IntoBytesExt 

Source
pub trait IntoBytesExt:
    IntoBytes
    + KnownLayout
    + Immutable
    + 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.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§