Skip to main content

rkyv/
alias.rs

1use crate::{
2    primitive::ArchivedIsize, rel_ptr, traits::ArchivePointee, Archive,
3    ArchiveUnsized,
4};
5
6/// The default raw relative pointer.
7///
8/// This will use an archived [`FixedIsize`](crate::primitive::FixedIsize) to
9/// hold the offset.
10pub type RawRelPtr = rel_ptr::RawRelPtr<ArchivedIsize>;
11
12/// The default relative pointer.
13///
14/// This will use an archived [`FixedIsize`](crate::primitive::FixedIsize) to
15/// hold the offset.
16pub type RelPtr<T> = rel_ptr::RelPtr<T, ArchivedIsize>;
17
18/// Alias for the archived version of some [`Archive`] type.
19///
20/// This can be useful for reducing the lengths of type definitions.
21pub type Archived<T> = <T as Archive>::Archived;
22
23/// Alias for the resolver for some [`Archive`] type.
24///
25/// This can be useful for reducing the lengths of type definitions.
26pub type Resolver<T> = <T as Archive>::Resolver;
27
28/// Alias for the archived metadata for some [`ArchiveUnsized`] type.
29///
30/// This can be useful for reducing the lengths of type definitions.
31pub type ArchivedMetadata<T> =
32    <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata;