Function rkyv::archived_unsized_root_mut[][src]

pub unsafe fn archived_unsized_root_mut<T: ArchiveUnsized + ?Sized>(
    bytes: Pin<&mut [u8]>
) -> Pin<&mut T::Archived>

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_mut 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 or use serialize_front instead.

Safety

The caller must guarantee that the byte slice represents an archived object and that the root object is stored at the end of the byte slice.