pub type Result<T> = std::result::Result<T, SplitError>;
#[derive(Debug, Clone)]
pub enum SplitError {
BadFileName,
NotAFunction,
MissingTypeSection,
MissingFunctionSection,
MissingCodeSection,
MissingExportSection,
MissingElementsSection,
TooManyTables,
NoTypeWithIndex(u32),
NoFunctionWithIndex(u32),
NoFunctionWithName(String),
}
impl std::fmt::Display for SplitError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Something when wrong while splitting: {:?}", self)
}
}