Function archived_value

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

Casts an archived value from the given byte slice at the given position.

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

ยงSafety

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