Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rkyv for JIT Engine #2250

Merged
merged 24 commits into from
Apr 30, 2021
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions lib/types/src/archives.rs
Original file line number Diff line number Diff line change
@@ -61,50 +61,6 @@ where
}
}

/// SecondaryMap after archive
// pub struct ArchivedSecondaryMap<K: EntityRef, V: Clone>(ArchivedVec<V>, V, PhantomData<K>);

// impl<K: Archive + EntityRef, V: Archive + Clone> Archive for SecondaryMap<K, V>
// where
// K::Archived: EntityRef,
// V::Archived: Clone,
// {
// type Archived = ArchivedSecondaryMap<K::Archived, V::Archived>;
// type Resolver = VecResolver<MetadataResolver<[V]>>;

// fn resolve(&self, pos: usize, resolver: Self::Resolver) -> Self::Archived {
// ArchivedSecondaryMap(Vec::resolve(&self.elems, pos, resolver), V::resolve(&self.default, pos, resolver), PhantomData)
// }
// }

// impl<K: Serialize<S> + EntityRef, V: Serialize<S> + Clone, S: Serializer + ?Sized> Serialize<S>
// for SecondaryMap<K, V>
// where
// K::Archived: EntityRef,
// V::Archived: Clone,
// {
// fn serialize(&self, serializer: &mut S) -> Result<Self::Resolver, S::Error> {
// self.elems.serialize(serializer)
// }
// }

// impl<K: Archive + EntityRef, V: Archive + Clone, D: Fallible + ?Sized> Deserialize<SecondaryMap<K, V>, D>
// for Archived<SecondaryMap<K, V>>
// where
// K::Archived: Deserialize<K, D> + EntityRef,
// V::Archived: Deserialize<V, D> + Clone,
// [V::Archived]: DeserializeUnsized<[V], D>,
// {
// fn deserialize(&self, deserializer: &mut D) -> Result<SecondaryMap<K, V>, D::Error> {
// let elems: Vec<_> = self.0.deserialize(deserializer)?;
// let default = self.1.deserialize(deserializer)?;
// Ok(SecondaryMap {
// elems,
// default,
// unused: PhantomData,
// })
// }
// }

#[derive(Serialize, Deserialize, Archive)]
/// Rkyv Archivable IndexMap
2 changes: 1 addition & 1 deletion lib/types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ pub use types::{
};

#[cfg(feature = "enable-rkyv")]
pub use archives::{ArchivableIndexMap, ArchivedPrimaryMap}; // ArchivedSecondaryMap
pub use archives::{ArchivableIndexMap, ArchivedPrimaryMap};

/// Version number of this crate.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");