pub struct Map<Archivable> { /* private fields */ }
Expand description
A generic wrapper that allows wrapping an Option<T>
.
Example
use rkyv::{Archive, with::{Map, RefAsBox}};
#[derive(Archive)]
struct Example<'a> {
#[with(Map<RefAsBox>)]
option: Option<&'a i32>,
#[with(Map<RefAsBox>)]
vec: Vec<&'a i32>,
}
Trait Implementations§
source§impl<A, O> ArchiveWith<Option<O>> for Map<A>where
A: ArchiveWith<O>,
impl<A, O> ArchiveWith<Option<O>> for Map<A>where A: ArchiveWith<O>,
§type Archived = ArchivedOption<<A as ArchiveWith<O>>::Archived>
type Archived = ArchivedOption<<A as ArchiveWith<O>>::Archived>
The archived type of a
With<F, Self>
.§type Resolver = Option<<A as ArchiveWith<O>>::Resolver>
type Resolver = Option<<A as ArchiveWith<O>>::Resolver>
The resolver of a
With<F, Self>
.source§impl<A, O> ArchiveWith<Vec<O, Global>> for Map<A>where
A: ArchiveWith<O>,
impl<A, O> ArchiveWith<Vec<O, Global>> for Map<A>where A: ArchiveWith<O>,
§type Archived = ArchivedVec<<A as ArchiveWith<O>>::Archived>
type Archived = ArchivedVec<<A as ArchiveWith<O>>::Archived>
The archived type of a
With<F, Self>
.§type Resolver = VecResolver
type Resolver = VecResolver
The resolver of a
With<F, Self>
.source§impl<A, O, D> DeserializeWith<ArchivedOption<<A as ArchiveWith<O>>::Archived>, Option<O>, D> for Map<A>where
D: Fallible,
A: ArchiveWith<O> + DeserializeWith<<A as ArchiveWith<O>>::Archived, O, D>,
impl<A, O, D> DeserializeWith<ArchivedOption<<A as ArchiveWith<O>>::Archived>, Option<O>, D> for Map<A>where D: Fallible, A: ArchiveWith<O> + DeserializeWith<<A as ArchiveWith<O>>::Archived, O, D>,
source§fn deserialize_with(
field: &ArchivedOption<<A as ArchiveWith<O>>::Archived>,
d: &mut D
) -> Result<Option<O>, D::Error>
fn deserialize_with( field: &ArchivedOption<<A as ArchiveWith<O>>::Archived>, d: &mut D ) -> Result<Option<O>, D::Error>
Deserializes the field type
F
using the given deserializer.source§impl<A, O, D> DeserializeWith<ArchivedVec<<A as ArchiveWith<O>>::Archived>, Vec<O, Global>, D> for Map<A>where
A: ArchiveWith<O> + DeserializeWith<<A as ArchiveWith<O>>::Archived, O, D>,
D: Fallible,
impl<A, O, D> DeserializeWith<ArchivedVec<<A as ArchiveWith<O>>::Archived>, Vec<O, Global>, D> for Map<A>where A: ArchiveWith<O> + DeserializeWith<<A as ArchiveWith<O>>::Archived, O, D>, D: Fallible,
source§fn deserialize_with(
field: &ArchivedVec<<A as ArchiveWith<O>>::Archived>,
d: &mut D
) -> Result<Vec<O>, D::Error>
fn deserialize_with( field: &ArchivedVec<<A as ArchiveWith<O>>::Archived>, d: &mut D ) -> Result<Vec<O>, D::Error>
Deserializes the field type
F
using the given deserializer.source§impl<A, O, S> SerializeWith<Option<O>, S> for Map<A>where
S: Fallible,
A: ArchiveWith<O> + SerializeWith<O, S>,
impl<A, O, S> SerializeWith<Option<O>, S> for Map<A>where S: Fallible, A: ArchiveWith<O> + SerializeWith<O, S>,
source§impl<A, O, S> SerializeWith<Vec<O, Global>, S> for Map<A>where
S: Fallible + ScratchSpace + Serializer,
A: ArchiveWith<O> + SerializeWith<O, S>,
impl<A, O, S> SerializeWith<Vec<O, Global>, S> for Map<A>where S: Fallible + ScratchSpace + Serializer, A: ArchiveWith<O> + SerializeWith<O, S>,
Auto Trait Implementations§
impl<Archivable> RefUnwindSafe for Map<Archivable>where Archivable: RefUnwindSafe,
impl<Archivable> Send for Map<Archivable>where Archivable: Send,
impl<Archivable> Sync for Map<Archivable>where Archivable: Sync,
impl<Archivable> Unpin for Map<Archivable>where Archivable: Unpin,
impl<Archivable> UnwindSafe for Map<Archivable>where Archivable: UnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.