pub struct Map<Archivable> { /* private fields */ }
Expand description
A generic wrapper that allows wrapping an Option
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
sourceimpl<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>
.
sourceimpl<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>
.
sourceimpl<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>,
sourcefn 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.
sourceimpl<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,
sourcefn 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.
sourceimpl<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>,
sourceimpl<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
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn 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.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more