section

Types

pub type RawSection {
  RawSection(
    type_id: Int,
    length: Int,
    content: Option(BitArray),
  )
}

Constructors

  • RawSection(type_id: Int, length: Int, content: Option(BitArray))
pub type Section {
  Custom(length: Int, name: String, data: Option(BitArray))
  Type(length: Int)
  Import(length: Int)
  Function(length: Int)
  Table(length: Int)
  Memory(length: Int, memories: List(Limits))
  Global(length: Int)
  Export(length: Int)
  Start(length: Int)
  Element(length: Int)
  Code(length: Int)
  Data(length: Int)
  DataCount(length: Int)
}

Constructors

  • Custom(length: Int, name: String, data: Option(BitArray))
  • Type(length: Int)
  • Import(length: Int)
  • Function(length: Int)
  • Table(length: Int)
  • Memory(length: Int, memories: List(Limits))
  • Global(length: Int)
  • Export(length: Int)
  • Start(length: Int)
  • Element(length: Int)
  • Code(length: Int)
  • Data(length: Int)
  • DataCount(length: Int)

Constants

pub const code_section_id: Int
pub const custom_section_id: Int
pub const data_count_section_id: Int
pub const data_section_id: Int
pub const element_section_id: Int
pub const export_section_id: Int
pub const function_section_id: Int
pub const global_section_id: Int
pub const import_section_id: Int
pub const memory_section_id: Int
pub const start_section_id: Int
pub const table_section_id: Int
pub const type_section_id: Int

Functions

pub fn decode_custom_section(
  raw_section: RawSection,
) -> Result(Section, String)
pub fn decode_memory_section(
  raw_section: RawSection,
) -> Result(Section, String)
pub fn decode_section(
  at position: Int,
  from raw_data: BitArray,
) -> Result(Section, String)
pub fn from_raw_data(
  at position: Int,
  from raw_data: BitArray,
) -> Result(Section, String)
pub fn parse_raw_section(
  at position: Int,
  from raw_data: BitArray,
) -> Result(RawSection, String)
Search Document