Function rkyv::util::archived_unsized_root

source ·
pub unsafe fn archived_unsized_root<T: ArchiveUnsized + ?Sized>(
    bytes: &[u8],
) -> &T::Archived
Expand description

Casts a RelPtr to the given unsized type from the given byte slice by calculating the root position.

This is a wrapper for archived_unsized_value that calculates the correct position of the root using the length of the byte slice. If your byte slice is not guaranteed to end immediately after the root object, you may need to store the position of the root object returned from serialize_unsized_value.

§Safety

  • The byte slice must represent an archived object
  • The root of the object must be stored at the end of the slice (this is the default behavior)