Struct rkyv::with::Atomic [−][src]
pub struct Atomic;
Expand description
A wrapper that archives an atomic with an underlying atomic.
By default, atomics are archived with an underlying integer.
Safety
This wrapper is only safe to use when the backing memory for wrapped types is mutable.
Example
use std::sync::atomic::AtomicU32; use rkyv::{Archive, with::Atomic}; #[derive(Archive)] struct Example { #[with(Atomic)] a: AtomicU32, }
Trait Implementations
type Archived = AtomicBool
type Archived = AtomicBool
The archived type of a With<F, Self>
.
unsafe fn resolve_with(
field: &AtomicBool,
_: usize,
_: Self::Resolver,
out: *mut Self::Archived
)
unsafe fn resolve_with(
field: &AtomicBool,
_: usize,
_: Self::Resolver,
out: *mut Self::Archived
)
Resolves the archived type using a reference to the field type F
. Read more
unsafe fn resolve_with(
field: &AtomicIsize,
_: usize,
_: Self::Resolver,
out: *mut Self::Archived
)
unsafe fn resolve_with(
field: &AtomicIsize,
_: usize,
_: Self::Resolver,
out: *mut Self::Archived
)
Resolves the archived type using a reference to the field type F
. Read more
unsafe fn resolve_with(
field: &AtomicUsize,
_: usize,
_: Self::Resolver,
out: *mut Self::Archived
)
unsafe fn resolve_with(
field: &AtomicUsize,
_: usize,
_: Self::Resolver,
out: *mut Self::Archived
)
Resolves the archived type using a reference to the field type F
. Read more
impl<D: Fallible + ?Sized> DeserializeWith<<Atomic as ArchiveWith<AtomicU32>>::Archived, AtomicUsize, D> for Atomic
impl<D: Fallible + ?Sized> DeserializeWith<<Atomic as ArchiveWith<AtomicU32>>::Archived, AtomicUsize, D> for Atomic
fn deserialize_with(
field: &<Self as ArchiveWith<AtomicU32>>::Archived,
_: &mut D
) -> Result<AtomicUsize, D::Error>
fn deserialize_with(
field: &<Self as ArchiveWith<AtomicU32>>::Archived,
_: &mut D
) -> Result<AtomicUsize, D::Error>
Deserializes the field type F
using the given deserializer.
impl<D: Fallible + ?Sized> DeserializeWith<<With<AtomicIsize, Atomic> as Archive>::Archived, AtomicIsize, D> for Atomic
impl<D: Fallible + ?Sized> DeserializeWith<<With<AtomicIsize, Atomic> as Archive>::Archived, AtomicIsize, D> for Atomic
fn deserialize_with(
field: &Archived<With<AtomicIsize, Self>>,
_: &mut D
) -> Result<AtomicIsize, D::Error>
fn deserialize_with(
field: &Archived<With<AtomicIsize, Self>>,
_: &mut D
) -> Result<AtomicIsize, D::Error>
Deserializes the field type F
using the given deserializer.
Deserializes the field type F
using the given deserializer.
Serializes the field type F
using the given serializer.
Serializes the field type F
using the given serializer.
Serializes the field type F
using the given serializer.
Auto Trait Implementations
impl RefUnwindSafe for Atomic
impl UnwindSafe for Atomic
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
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
D: Fallible + ?Sized,
F: ?Sized,
W: DeserializeWith<F, T, D>,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
D: Fallible + ?Sized,
F: ?Sized,
W: DeserializeWith<F, T, D>,