Struct rkyv::vec::ArchivedVec [−][src]
pub struct ArchivedVec<T> { /* fields omitted */ }
Expand description
An archived Vec
.
This uses a RelPtr
to a [T]
under the hood. Unlike
ArchivedString
, it does not have an inline representation.
Implementations
Gets the elements of the archived vec as a pinned mutable slice.
Gets the element at the given index ot this archived vec as a pinned mutable reference.
pub unsafe fn resolve_from_slice<U: Archive<Archived = T>>(
slice: &[U],
pos: usize,
resolver: VecResolver,
out: *mut Self
)
pub unsafe fn resolve_from_slice<U: Archive<Archived = T>>(
slice: &[U],
pos: usize,
resolver: VecResolver,
out: *mut Self
)
Resolves an archived Vec
from a given slice.
Safety
pos
must be the position ofout
within the archiveresolver
must be the result of serializingvalue
Resolves an archived Vec
from a given length.
Safety
pos
must be the position ofout
within the archiveresolver
must bet he result of serializingvalue
pub fn serialize_from_slice<U: Serialize<S, Archived = T>, S: Serializer + ?Sized>(
slice: &[U],
serializer: &mut S
) -> Result<VecResolver, S::Error> where
[U]: SerializeUnsized<S>,
pub fn serialize_from_slice<U: Serialize<S, Archived = T>, S: Serializer + ?Sized>(
slice: &[U],
serializer: &mut S
) -> Result<VecResolver, S::Error> where
[U]: SerializeUnsized<S>,
Serializes an archived Vec
from a given slice.
pub fn serialize_from_iter<U, B, I, S: ?Sized>(
iter: I,
serializer: &mut S
) -> Result<VecResolver, S::Error> where
U: Serialize<S, Archived = T>,
B: Borrow<U>,
I: ExactSizeIterator<Item = B>,
S: ScratchSpace + Serializer + ?Sized,
pub fn serialize_from_iter<U, B, I, S: ?Sized>(
iter: I,
serializer: &mut S
) -> Result<VecResolver, S::Error> where
U: Serialize<S, Archived = T>,
B: Borrow<U>,
I: ExactSizeIterator<Item = B>,
S: ScratchSpace + Serializer + ?Sized,
Serializes an archived Vec
from a given iterator.
This method is unable to perform copy optimizations; prefer
serialize_from_slice
when possible.
Trait Implementations
impl<T, C: ?Sized> CheckBytes<C> for ArchivedVec<T> where
T: CheckBytes<C>,
C: ArchiveContext + ?Sized,
C::Error: Error,
impl<T, C: ?Sized> CheckBytes<C> for ArchivedVec<T> where
T: CheckBytes<C>,
C: ArchiveContext + ?Sized,
C::Error: Error,
type Error = CheckOwnedPointerError<[T], C>
type Error = CheckOwnedPointerError<[T], C>
The error that may result from checking the type.
unsafe fn check_bytes<'a>(
value: *const Self,
context: &mut C
) -> Result<&'a Self, Self::Error>
unsafe fn check_bytes<'a>(
value: *const Self,
context: &mut C
) -> Result<&'a Self, Self::Error>
Checks whether the given pointer points to a valid value within the given context. Read more
impl<T: Archive, D: Fallible + ?Sized> Deserialize<Vec<T, Global>, D> for ArchivedVec<T::Archived> where
[T::Archived]: DeserializeUnsized<[T], D>,
impl<T: Archive, D: Fallible + ?Sized> Deserialize<Vec<T, Global>, D> for ArchivedVec<T::Archived> where
[T::Archived]: DeserializeUnsized<[T], D>,
impl<T, D: ?Sized> DeserializeWith<ArchivedVec<<T as Archive>::Archived>, BTreeSet<T>, D> for AsVec where
T: Archive + Ord,
T::Archived: Deserialize<T, D>,
D: Fallible + ?Sized,
impl<T, D: ?Sized> DeserializeWith<ArchivedVec<<T as Archive>::Archived>, BTreeSet<T>, D> for AsVec where
T: Archive + Ord,
T::Archived: Deserialize<T, D>,
D: Fallible + ?Sized,
fn deserialize_with(
field: &ArchivedVec<T::Archived>,
deserializer: &mut D
) -> Result<BTreeSet<T>, D::Error>
fn deserialize_with(
field: &ArchivedVec<T::Archived>,
deserializer: &mut D
) -> Result<BTreeSet<T>, D::Error>
Deserializes the field type F
using the given deserializer.
fn deserialize_with(
field: &ArchivedVec<T::Archived>,
deserializer: &mut D
) -> Result<Cow<'a, [T]>, D::Error>
fn deserialize_with(
field: &ArchivedVec<T::Archived>,
deserializer: &mut D
) -> Result<Cow<'a, [T]>, D::Error>
Deserializes the field type F
using the given deserializer.
impl<T, D: ?Sized> DeserializeWith<ArchivedVec<<T as Archive>::Archived>, HashSet<T, RandomState>, D> for AsVec where
T: Archive + Hash + Eq,
T::Archived: Deserialize<T, D>,
D: Fallible + ?Sized,
impl<T, D: ?Sized> DeserializeWith<ArchivedVec<<T as Archive>::Archived>, HashSet<T, RandomState>, D> for AsVec where
T: Archive + Hash + Eq,
T::Archived: Deserialize<T, D>,
D: Fallible + ?Sized,
fn deserialize_with(
field: &ArchivedVec<T::Archived>,
deserializer: &mut D
) -> Result<HashSet<T>, D::Error>
fn deserialize_with(
field: &ArchivedVec<T::Archived>,
deserializer: &mut D
) -> Result<HashSet<T>, D::Error>
Deserializes the field type F
using the given deserializer.
impl<K, V, D: ?Sized> DeserializeWith<ArchivedVec<Entry<<K as Archive>::Archived, <V as Archive>::Archived>>, BTreeMap<K, V>, D> for AsVec where
K: Archive + Ord,
V: Archive,
K::Archived: Deserialize<K, D>,
V::Archived: Deserialize<V, D>,
D: Fallible + ?Sized,
impl<K, V, D: ?Sized> DeserializeWith<ArchivedVec<Entry<<K as Archive>::Archived, <V as Archive>::Archived>>, BTreeMap<K, V>, D> for AsVec where
K: Archive + Ord,
V: Archive,
K::Archived: Deserialize<K, D>,
V::Archived: Deserialize<V, D>,
D: Fallible + ?Sized,
fn deserialize_with(
field: &ArchivedVec<Entry<K::Archived, V::Archived>>,
deserializer: &mut D
) -> Result<BTreeMap<K, V>, D::Error>
fn deserialize_with(
field: &ArchivedVec<Entry<K::Archived, V::Archived>>,
deserializer: &mut D
) -> Result<BTreeMap<K, V>, D::Error>
Deserializes the field type F
using the given deserializer.
impl<K, V, D: ?Sized> DeserializeWith<ArchivedVec<Entry<<K as Archive>::Archived, <V as Archive>::Archived>>, HashMap<K, V, RandomState>, D> for AsVec where
K: Archive + Hash + Eq,
V: Archive,
K::Archived: Deserialize<K, D>,
V::Archived: Deserialize<V, D>,
D: Fallible + ?Sized,
impl<K, V, D: ?Sized> DeserializeWith<ArchivedVec<Entry<<K as Archive>::Archived, <V as Archive>::Archived>>, HashMap<K, V, RandomState>, D> for AsVec where
K: Archive + Hash + Eq,
V: Archive,
K::Archived: Deserialize<K, D>,
V::Archived: Deserialize<V, D>,
D: Fallible + ?Sized,
fn deserialize_with(
field: &ArchivedVec<Entry<K::Archived, V::Archived>>,
deserializer: &mut D
) -> Result<HashMap<K, V>, D::Error>
fn deserialize_with(
field: &ArchivedVec<Entry<K::Archived, V::Archived>>,
deserializer: &mut D
) -> Result<HashMap<K, V>, D::Error>
Deserializes the field type F
using the given deserializer.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for ArchivedVec<T> where
T: RefUnwindSafe,
impl<T> Send for ArchivedVec<T> where
T: Send,
impl<T> Sync for ArchivedVec<T> where
T: Sync,
impl<T> !Unpin for ArchivedVec<T>
impl<T> UnwindSafe for ArchivedVec<T> where
T: UnwindSafe,
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