Struct rkyv::with::RefAsBox [−][src]
pub struct RefAsBox;Expand description
A wrapper that serializes a reference as if it were boxed.
Unlike Inline, unsized references can be serialized with RefAsBox.
References serialized with RefAsBox cannot be deserialized because the struct cannot own the
deserialized value.
Example
use rkyv::{Archive, with::RefAsBox};
#[derive(Archive)]
struct Example<'a> {
#[with(RefAsBox)]
a: &'a i32,
#[with(RefAsBox)]
b: &'a str,
}Trait Implementations
type Archived = ArchivedBox<F::Archived>
type Archived = ArchivedBox<F::Archived>
The archived type of a With<F, Self>.
type Resolver = BoxResolver<F::MetadataResolver>
type Resolver = BoxResolver<F::MetadataResolver>
The resolver of a With<F, Self>.
impl<F: SerializeUnsized<S> + ?Sized, S: Fallible + ?Sized> SerializeWith<&'_ F, S> for RefAsBox
impl<F: SerializeUnsized<S> + ?Sized, S: Fallible + ?Sized> SerializeWith<&'_ F, S> for RefAsBox
Auto Trait Implementations
impl RefUnwindSafe for RefAsBox
impl UnwindSafe for RefAsBox
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more