also module extensions

This commit is contained in:
NikVolf
2017-04-07 20:00:30 +03:00
parent ceca58431b
commit f85ef8f5f8
2 changed files with 48 additions and 1 deletions

View File

@ -457,6 +457,7 @@ impl Serialize for ExportSection {
}
/// Section with function bodies of the module.
#[derive(Default)]
pub struct CodeSection(Vec<FuncBody>);
impl CodeSection {
@ -465,10 +466,15 @@ impl CodeSection {
CodeSection(bodies)
}
/// All function bodies in the section
/// All function bodies in the section.
pub fn bodies(&self) -> &[FuncBody] {
&self.0
}
/// All function bodies in the section, mutable.
pub fn bodies_mut(&mut self) -> &mut Vec<FuncBody> {
&mut self.0
}
}
impl Deserialize for CodeSection {