devela::_dep::rkyv

Trait DeserializeUnsized

pub trait DeserializeUnsized<T, D>: ArchivePointee
where T: Pointee + ?Sized, D: Fallible + ?Sized,
{ // Required methods unsafe fn deserialize_unsized( &self, deserializer: &mut D, out: *mut T, ) -> Result<(), <D as Fallible>::Error> ; fn deserialize_metadata(&self) -> <T as Pointee>::Metadata; }
Available on crate feature dep_rkyv only.
Expand description

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

Required Methods§

unsafe fn deserialize_unsized( &self, deserializer: &mut D, out: *mut T, ) -> Result<(), <D as Fallible>::Error>

Deserializes a reference to the given value.

§Safety

out must be non-null, properly-aligned, and valid for writes. It must be allocated according to the layout of the deserialized metadata.

fn deserialize_metadata(&self) -> <T as Pointee>::Metadata

Deserializes the metadata for the given type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl<D> DeserializeUnsized<str, D> for str
where D: Fallible + ?Sized,

§

unsafe fn deserialize_unsized( &self, _: &mut D, out: *mut str, ) -> Result<(), <D as Fallible>::Error>

§

fn deserialize_metadata(&self) -> <str as Pointee>::Metadata

§

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

§

unsafe fn deserialize_unsized( &self, deserializer: &mut D, out: *mut [U], ) -> Result<(), <D as Fallible>::Error>

§

fn deserialize_metadata(&self) -> <[U] as Pointee>::Metadata

Implementors§

§

impl<D> DeserializeUnsized<CStr, D> for CStr
where D: Fallible + ?Sized,

§

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