parse and store custom sections from wasm, guarded by vfs feature flag

This commit is contained in:
Mackenzie Clark
2019-03-12 10:45:44 -07:00
parent f014a05304
commit b9c3a49f3c
6 changed files with 53 additions and 5 deletions

View File

@ -8,6 +8,8 @@ pub type LinkResult<T> = std::result::Result<T, Vec<LinkError>>;
pub type RuntimeResult<T> = std::result::Result<T, RuntimeError>;
pub type CallResult<T> = std::result::Result<T, CallError>;
pub type ResolveResult<T> = std::result::Result<T, ResolveError>;
#[cfg(feature = "vfs")]
pub type ParseResult<T> = std::result::Result<T, ParseError>;
/// This is returned when the chosen compiler is unable to
/// successfully compile the provided webassembly module into
@ -445,3 +447,16 @@ impl Into<GrowError> for MemoryProtectionError {
GrowError::CouldNotProtectMemory(self)
}
}
#[cfg(feature = "vfs")]
#[derive(Debug)]
pub enum ParseError {
BinaryReadError,
}
#[cfg(feature = "vfs")]
impl From<wasmparser::BinaryReaderError> for ParseError {
fn from(_: wasmparser::BinaryReaderError) -> Self {
ParseError::BinaryReadError
}
}