This commit is contained in:
NikVolf
2017-04-04 03:03:57 +03:00
parent 15035de380
commit 321d1cf4e6
12 changed files with 155 additions and 2 deletions

View File

@ -1,10 +1,15 @@
use std::io;
use super::{Deserialize, Serialize, Error, VarUint7, VarUint32};
/// Internal reference of the exported entry.
pub enum Internal {
/// Function reference.
Function(u32),
/// Table reference.
Table(u32),
/// Memory reference.
Memory(u32),
/// Global reference.
Global(u32),
}
@ -41,13 +46,16 @@ impl Serialize for Internal {
}
}
/// Export entry.
pub struct ExportEntry {
field_str: String,
internal: Internal,
}
impl ExportEntry {
/// Public name
pub fn field(&self) -> &str { &self.field_str }
/// Internal reference of the export entry.
pub fn internal(&self) -> &Internal { &self.internal }
}