Function archived_unsized_value

Source
pub unsafe fn archived_unsized_value<T: ArchiveUnsized + ?Sized>(
    bytes: &[u8],
    pos: usize,
) -> &T::Archived
Expand description

Casts a RelPtr to the given unsized type from the given byte slice at the given position and returns the value it points to.

This helps avoid situations where lifetimes get inappropriately assigned and allow buffer mutation after getting archived value references.

ยงSafety

A RelPtr<T::Archived> must be archived at the given position in the byte slice.