Struct rkyv::boxed::ArchivedBox
source · pub struct ArchivedBox<T: ArchivePointee + ?Sized>(/* private fields */);
Implementations§
source§impl<T: ArchivePointee + ?Sized> ArchivedBox<T>
impl<T: ArchivePointee + ?Sized> ArchivedBox<T>
sourcepub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>
Returns a pinned mutable reference to the value of this archived box
sourcepub unsafe fn resolve_from_ref<U: ArchiveUnsized<Archived = T> + ?Sized>(
value: &U,
pos: usize,
resolver: BoxResolver<U::MetadataResolver>,
out: *mut Self,
)
pub unsafe fn resolve_from_ref<U: ArchiveUnsized<Archived = T> + ?Sized>( value: &U, pos: usize, resolver: BoxResolver<U::MetadataResolver>, out: *mut Self, )
Resolves an archived box from the given value and parameters.
§Safety
pos
must be the position ofout
within the archiveresolver
must be the result of serializingvalue
sourcepub fn serialize_from_ref<U, S>(
value: &U,
serializer: &mut S,
) -> Result<BoxResolver<U::MetadataResolver>, S::Error>
pub fn serialize_from_ref<U, S>( value: &U, serializer: &mut S, ) -> Result<BoxResolver<U::MetadataResolver>, S::Error>
Serializes an archived box from the given value and serializer.
sourcepub unsafe fn resolve_from_raw_parts(
pos: usize,
resolver: BoxResolver<<T as ArchivePointee>::ArchivedMetadata>,
out: *mut Self,
)
pub unsafe fn resolve_from_raw_parts( pos: usize, resolver: BoxResolver<<T as ArchivePointee>::ArchivedMetadata>, out: *mut Self, )
Resolves an archived box from a BoxResolver
which contains
the raw <T as ArchivePointee>::ArchivedMetadata
directly.
§Safety
pos
must be the position ofout
within the archiveresolver
must be obtained by following the safety documentation ofBoxResolver::from_raw_parts
.
source§impl<T> ArchivedBox<[T]>
impl<T> ArchivedBox<[T]>
sourcepub unsafe fn serialize_copy_from_slice<U, S>(
slice: &[U],
serializer: &mut S,
) -> Result<BoxResolver<MetadataResolver<[U]>>, S::Error>
pub unsafe fn serialize_copy_from_slice<U, S>( slice: &[U], serializer: &mut S, ) -> Result<BoxResolver<MetadataResolver<[U]>>, S::Error>
Serializes an archived Box
from a given slice by directly copying bytes.
§Safety
The type being serialized must be copy-safe. Copy-safe types must be trivially copyable (have the same archived and unarchived representations) and contain no padding bytes. In situations where copying uninitialized bytes the output is acceptable, this function may be used with types that contain padding bytes.
Trait Implementations§
source§impl<T: ArchivePointee + ?Sized> AsRef<T> for ArchivedBox<T>
impl<T: ArchivePointee + ?Sized> AsRef<T> for ArchivedBox<T>
source§impl<T: ArchivePointee + ?Sized> Borrow<T> for ArchivedBox<T>
impl<T: ArchivePointee + ?Sized> Borrow<T> for ArchivedBox<T>
source§impl<T: ArchivePointee + ?Sized> Debug for ArchivedBox<T>where
T::ArchivedMetadata: Debug,
impl<T: ArchivePointee + ?Sized> Debug for ArchivedBox<T>where
T::ArchivedMetadata: Debug,
source§impl<T: ArchivePointee + ?Sized> Deref for ArchivedBox<T>
impl<T: ArchivePointee + ?Sized> Deref for ArchivedBox<T>
source§impl<T, D> Deserialize<Box<T>, D> for ArchivedBox<T::Archived>
impl<T, D> Deserialize<Box<T>, D> for ArchivedBox<T::Archived>
source§impl<F: Archive, D: Fallible + ?Sized> DeserializeWith<ArchivedBox<<F as Archive>::Archived>, F, D> for AsBoxwhere
F::Archived: Deserialize<F, D>,
impl<F: Archive, D: Fallible + ?Sized> DeserializeWith<ArchivedBox<<F as Archive>::Archived>, F, D> for AsBoxwhere
F::Archived: Deserialize<F, D>,
source§fn deserialize_with(
field: &ArchivedBox<F::Archived>,
deserializer: &mut D,
) -> Result<F, D::Error>
fn deserialize_with( field: &ArchivedBox<F::Archived>, deserializer: &mut D, ) -> Result<F, D::Error>
Deserializes the field type
F
using the given deserializer.source§impl<T, D> DeserializeWith<ArchivedBox<[<T as Archive>::Archived]>, Box<[T]>, D> for CopyOptimize
impl<T, D> DeserializeWith<ArchivedBox<[<T as Archive>::Archived]>, Box<[T]>, D> for CopyOptimize
source§fn deserialize_with(
field: &ArchivedBox<[T::Archived]>,
_: &mut D,
) -> Result<Box<[T]>, D::Error>
fn deserialize_with( field: &ArchivedBox<[T::Archived]>, _: &mut D, ) -> Result<Box<[T]>, D::Error>
Deserializes the field type
F
using the given deserializer.source§impl<T: ArchivePointee + Display + ?Sized> Display for ArchivedBox<T>
impl<T: ArchivePointee + Display + ?Sized> Display for ArchivedBox<T>
source§impl<T: ArchivePointee + Hash + ?Sized> Hash for ArchivedBox<T>
impl<T: ArchivePointee + Hash + ?Sized> Hash for ArchivedBox<T>
source§impl<T: ArchivePointee + Ord + ?Sized> Ord for ArchivedBox<T>
impl<T: ArchivePointee + Ord + ?Sized> Ord for ArchivedBox<T>
source§impl<T: ArchivePointee + PartialEq<U> + ?Sized, U: ArchivePointee + ?Sized> PartialEq<ArchivedBox<U>> for ArchivedBox<T>
impl<T: ArchivePointee + PartialEq<U> + ?Sized, U: ArchivePointee + ?Sized> PartialEq<ArchivedBox<U>> for ArchivedBox<T>
source§fn eq(&self, other: &ArchivedBox<U>) -> bool
fn eq(&self, other: &ArchivedBox<U>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: ArchivePointee + PartialEq<U> + ?Sized, U: ?Sized> PartialEq<Box<U>> for ArchivedBox<T>
impl<T: ArchivePointee + PartialEq<U> + ?Sized, U: ?Sized> PartialEq<Box<U>> for ArchivedBox<T>
source§impl<T: ArchivePointee + PartialOrd<U> + ?Sized, U: ?Sized> PartialOrd<Box<U>> for ArchivedBox<T>
impl<T: ArchivePointee + PartialOrd<U> + ?Sized, U: ?Sized> PartialOrd<Box<U>> for ArchivedBox<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T: ArchivePointee + PartialOrd + ?Sized> PartialOrd for ArchivedBox<T>
impl<T: ArchivePointee + PartialOrd + ?Sized> PartialOrd for ArchivedBox<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T: ArchivePointee + ?Sized> Pointer for ArchivedBox<T>
impl<T: ArchivePointee + ?Sized> Pointer for ArchivedBox<T>
impl<T: ArchivePointee + Eq + ?Sized> Eq for ArchivedBox<T>
Auto Trait Implementations§
impl<T> Freeze for ArchivedBox<T>
impl<T> RefUnwindSafe for ArchivedBox<T>
impl<T> Send for ArchivedBox<T>
impl<T> Sync for ArchivedBox<T>
impl<T> !Unpin for ArchivedBox<T>
impl<T> UnwindSafe for ArchivedBox<T>
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<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more