Trait rkyv::DeserializeUnsized

source ·
pub trait DeserializeUnsized<T: Pointee + ?Sized, D: Fallible + ?Sized>: ArchivePointee {
    // Required methods
    unsafe fn deserialize_unsized(
        &self,
        deserializer: &mut D,
        alloc: impl FnMut(Layout) -> *mut u8,
    ) -> Result<*mut (), D::Error>;
    fn deserialize_metadata(
        &self,
        deserializer: &mut D,
    ) -> Result<T::Metadata, D::Error>;
}
Expand description

A counterpart of Deserialize that’s suitable for unsized types.

Required Methods§

source

unsafe fn deserialize_unsized( &self, deserializer: &mut D, alloc: impl FnMut(Layout) -> *mut u8, ) -> Result<*mut (), D::Error>

Deserializes a reference to the given value.

§Safety

out must point to memory with the layout returned by deserialized_layout.

source

fn deserialize_metadata( &self, deserializer: &mut D, ) -> Result<T::Metadata, D::Error>

Deserializes the metadata for the given type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<D: Fallible + ?Sized> DeserializeUnsized<str, D> for <str as ArchiveUnsized>::Archived

source§

unsafe fn deserialize_unsized( &self, _: &mut D, alloc: impl FnMut(Layout) -> *mut u8, ) -> Result<*mut (), D::Error>

source§

fn deserialize_metadata( &self, _: &mut D, ) -> Result<<str as Pointee>::Metadata, D::Error>

source§

impl<D: Fallible + ?Sized> DeserializeUnsized<CStr, D> for <CStr as ArchiveUnsized>::Archived

source§

unsafe fn deserialize_unsized( &self, _: &mut D, alloc: impl FnMut(Layout) -> *mut u8, ) -> Result<*mut (), D::Error>

source§

fn deserialize_metadata( &self, _: &mut D, ) -> Result<<CStr as Pointee>::Metadata, D::Error>

source§

impl<T: Deserialize<U, D>, U, D: Fallible + ?Sized> DeserializeUnsized<[U], D> for [T]

source§

unsafe fn deserialize_unsized( &self, deserializer: &mut D, alloc: impl FnMut(Layout) -> *mut u8, ) -> Result<*mut (), D::Error>

source§

fn deserialize_metadata( &self, _: &mut D, ) -> Result<<[U] as Pointee>::Metadata, D::Error>

Implementors§

source§

impl<T: Archive, D: Fallible + ?Sized> DeserializeUnsized<T, D> for T::Archived
where T::Archived: Deserialize<T, D>,