mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-24 05:01:34 +00:00
extend public api
This commit is contained in:
parent
a200bd0862
commit
06aaf4a750
@ -17,7 +17,7 @@ pub use self::module::Module;
|
||||
pub use self::section::{
|
||||
Section, FunctionSection, CodeSection, MemorySection, DataSection,
|
||||
ImportSection, ExportSection, GlobalSection, TypeSection, ElementSection,
|
||||
TableSection,
|
||||
TableSection, CustomSection,
|
||||
};
|
||||
pub use self::import_entry::{ImportEntry, ResizableLimits, MemoryType, TableType, GlobalType, External};
|
||||
pub use self::export_entry::{ExportEntry, Internal};
|
||||
|
@ -178,11 +178,35 @@ impl Serialize for Section {
|
||||
}
|
||||
}
|
||||
|
||||
/// Custom section
|
||||
pub struct CustomSection {
|
||||
name: String,
|
||||
payload: Vec<u8>,
|
||||
}
|
||||
|
||||
impl CustomSection {
|
||||
|
||||
/// Name of the custom section
|
||||
pub fn name(&self) -> &str {
|
||||
&self.name
|
||||
}
|
||||
|
||||
/// Payload of the custom secion
|
||||
pub fn payload(&self) -> &[u8] {
|
||||
&self.payload
|
||||
}
|
||||
|
||||
/// Name of the custom section (mutable)
|
||||
pub fn name_mut(&mut self) -> &mut String {
|
||||
&mut self.name
|
||||
}
|
||||
|
||||
/// Payload of the custom section (mutable)
|
||||
pub fn payload_mut(&mut self) -> &mut Vec<u8> {
|
||||
&mut self.payload
|
||||
}
|
||||
}
|
||||
|
||||
impl Deserialize for CustomSection {
|
||||
type Error = Error;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user