Serialize and deserialize compilation artifacts. (#2020)
* Serialize and deserialize Module * Use bincode to serialize * Add wasm_module_serialize; docs * Simple tests
This commit is contained in:
@@ -45,7 +45,7 @@ pub trait Configurable {
|
||||
}
|
||||
|
||||
/// Collect settings values based on a template.
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Hash)]
|
||||
pub struct Builder {
|
||||
template: &'static detail::Template,
|
||||
bytes: Box<[u8]>,
|
||||
@@ -212,8 +212,10 @@ impl<'a> PredicateView<'a> {
|
||||
pub mod detail {
|
||||
use crate::constant_hash;
|
||||
use core::fmt;
|
||||
use core::hash::Hash;
|
||||
|
||||
/// An instruction group template.
|
||||
#[derive(Hash)]
|
||||
pub struct Template {
|
||||
/// Name of the instruction group.
|
||||
pub name: &'static str,
|
||||
@@ -281,6 +283,7 @@ pub mod detail {
|
||||
/// A setting descriptor holds the information needed to generically set and print a setting.
|
||||
///
|
||||
/// Each settings group will be represented as a constant DESCRIPTORS array.
|
||||
#[derive(Hash)]
|
||||
pub struct Descriptor {
|
||||
/// Lower snake-case name of setting as defined in meta.
|
||||
pub name: &'static str,
|
||||
@@ -293,7 +296,7 @@ pub mod detail {
|
||||
}
|
||||
|
||||
/// The different kind of settings along with descriptor bits that depend on the kind.
|
||||
#[derive(Clone, Copy)]
|
||||
#[derive(Clone, Copy, Hash)]
|
||||
pub enum Detail {
|
||||
/// A boolean setting only uses one bit, numbered from LSB.
|
||||
Bool {
|
||||
|
||||
Reference in New Issue
Block a user