wasmi/parity_wasm/elements/index.html

83 lines
20 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `elements` mod in crate `parity_wasm`."><meta name="keywords" content="rust, rustlang, rust-lang, elements"><title>parity_wasm::elements - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../parity_wasm/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module elements</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>parity_wasm</a></p><script>window.sidebarCurrent = {name: 'elements', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/parity_wasm/elements/mod.rs.html#1-330' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>parity_wasm</a>::<wbr><a class="mod" href=''>elements</a></span></h1><div class='docblock'><p>Elements of the WebAssembly binary format.</p>
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table><tr class='module-item'><td><a class="mod" href="opcodes/index.html" title='parity_wasm::elements::opcodes mod'>opcodes</a></td><td class='docblock-short'></td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.BrTableData.html" title='parity_wasm::elements::BrTableData struct'>BrTableData</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.CodeSection.html" title='parity_wasm::elements::CodeSection struct'>CodeSection</a></td><td class='docblock-short'><p>Section with function bodies of the module.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.CountedList.html" title='parity_wasm::elements::CountedList struct'>CountedList</a></td><td class='docblock-short'><p>List for reading sequence of elements typed <code>T</code>, given
they are preceded by length (serialized as VarUint32).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.CountedListWriter.html" title='parity_wasm::elements::CountedListWriter struct'>CountedListWriter</a></td><td class='docblock-short'><p>Helper struct to write series of <code>T</code> preceded by the length of the sequence
serialized as VarUint32.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.CountedWriter.html" title='parity_wasm::elements::CountedWriter struct'>CountedWriter</a></td><td class='docblock-short'><p>Helper struct to write payload which is preceded by
it's own length in bytes.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.CustomSection.html" title='parity_wasm::elements::CustomSection struct'>CustomSection</a></td><td class='docblock-short'><p>Custom section.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.DataSection.html" title='parity_wasm::elements::DataSection struct'>DataSection</a></td><td class='docblock-short'><p>Data entries definitions.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.DataSegment.html" title='parity_wasm::elements::DataSegment struct'>DataSegment</a></td><td class='docblock-short'><p>Data segment definition.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ElementSection.html" title='parity_wasm::elements::ElementSection struct'>ElementSection</a></td><td class='docblock-short'><p>Element entries section.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ElementSegment.html" title='parity_wasm::elements::ElementSegment struct'>ElementSegment</a></td><td class='docblock-short'><p>Entry in the element section.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ExportEntry.html" title='parity_wasm::elements::ExportEntry struct'>ExportEntry</a></td><td class='docblock-short'><p>Export entry.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ExportSection.html" title='parity_wasm::elements::ExportSection struct'>ExportSection</a></td><td class='docblock-short'><p>List of exports definition.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Func.html" title='parity_wasm::elements::Func struct'>Func</a></td><td class='docblock-short'><p>Function signature (type reference)</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.FuncBody.html" title='parity_wasm::elements::FuncBody struct'>FuncBody</a></td><td class='docblock-short'><p>Function body definition.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.FunctionNameSubsection.html" title='parity_wasm::elements::FunctionNameSubsection struct'>FunctionNameSubsection</a></td><td class='docblock-short'><p>The names of the functions in this module.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.FunctionSection.html" title='parity_wasm::elements::FunctionSection struct'>FunctionSection</a></td><td class='docblock-short'><p>Section with function signatures definition.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.FunctionType.html" title='parity_wasm::elements::FunctionType struct'>FunctionType</a></td><td class='docblock-short'><p>Function signature type.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.GlobalEntry.html" title='parity_wasm::elements::GlobalEntry struct'>GlobalEntry</a></td><td class='docblock-short'><p>Global entry in the module.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.GlobalSection.html" title='parity_wasm::elements::GlobalSection struct'>GlobalSection</a></td><td class='docblock-short'><p>Globals definition section.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.GlobalType.html" title='parity_wasm::elements::GlobalType struct'>GlobalType</a></td><td class='docblock-short'><p>Global definition struct</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ImportEntry.html" title='parity_wasm::elements::ImportEntry struct'>ImportEntry</a></td><td class='docblock-short'><p>Import entry.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ImportSection.html" title='parity_wasm::elements::ImportSection struct'>ImportSection</a></td><td class='docblock-short'><p>Section of the imports definition.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.IndexMap.html" title='parity_wasm::elements::IndexMap struct'>IndexMap</a></td><td class='docblock-short'><p>A map from non-contiguous <code>u32</code> keys to values of type <code>T</code>, which is
serialized and deserialized ascending order of the keys. Normally used for
relative dense maps with occasional &quot;holes&quot;, and stored as an array.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.InitExpr.html" title='parity_wasm::elements::InitExpr struct'>InitExpr</a></td><td class='docblock-short'><p>Initialization expression.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Instructions.html" title='parity_wasm::elements::Instructions struct'>Instructions</a></td><td class='docblock-short'><p>List of instructions (usually inside a block section).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Local.html" title='parity_wasm::elements::Local struct'>Local</a></td><td class='docblock-short'><p>Local definition inside the function body.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.LocalNameSubsection.html" title='parity_wasm::elements::LocalNameSubsection struct'>LocalNameSubsection</a></td><td class='docblock-short'><p>The names of the local variables in this module's functions.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MemorySection.html" title='parity_wasm::elements::MemorySection struct'>MemorySection</a></td><td class='docblock-short'><p>Section with table definition (currently only one entry is allowed).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MemoryType.html" title='parity_wasm::elements::MemoryType struct'>MemoryType</a></td><td class='docblock-short'><p>Memory entry.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Module.html" title='parity_wasm::elements::Module struct'>Module</a></td><td class='docblock-short'><p>WebAssembly module</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ModuleNameSubsection.html" title='parity_wasm::elements::ModuleNameSubsection struct'>ModuleNameSubsection</a></td><td class='docblock-short'><p>The name of this module.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.NameSection.html" title='parity_wasm::elements::NameSection struct'>NameSection</a></td><td class='docblock-short'><p>Debug name information.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.RelocSection.html" title='parity_wasm::elements::RelocSection struct'>RelocSection</a></td><td class='docblock-short'><p>Relocation information.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ResizableLimits.html" title='parity_wasm::elements::ResizableLimits struct'>ResizableLimits</a></td><td class='docblock-short'><p>Memory and table limits.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.TableSection.html" title='parity_wasm::elements::TableSection struct'>TableSection</a></td><td class='docblock-short'><p>Section with table definition (currently only one is allowed).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.TableType.html" title='parity_wasm::elements::TableType struct'>TableType</a></td><td class='docblock-short'><p>Table entry</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.TypeSection.html" title='parity_wasm::elements::TypeSection struct'>TypeSection</a></td><td class='docblock-short'><p>Section with type declarations.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Uint8.html" title='parity_wasm::elements::Uint8 struct'>Uint8</a></td><td class='docblock-short'><p>8-bit unsigned integer, NOT encoded in LEB128;
it's just a single byte.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Uint32.html" title='parity_wasm::elements::Uint32 struct'>Uint32</a></td><td class='docblock-short'><p>32-bit unsigned integer, encoded in little endian.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Uint64.html" title='parity_wasm::elements::Uint64 struct'>Uint64</a></td><td class='docblock-short'><p>64-bit unsigned integer, encoded in little endian.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Unparsed.html" title='parity_wasm::elements::Unparsed struct'>Unparsed</a></td><td class='docblock-short'><p>Unparsed part of the module/section.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.VarInt7.html" title='parity_wasm::elements::VarInt7 struct'>VarInt7</a></td><td class='docblock-short'><p>7-bit signed integer, encoded in LEB128 (always 1 byte length)</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.VarInt32.html" title='parity_wasm::elements::VarInt32 struct'>VarInt32</a></td><td class='docblock-short'><p>32-bit signed integer, encoded in LEB128 (can be 1-5 bytes length).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.VarInt64.html" title='parity_wasm::elements::VarInt64 struct'>VarInt64</a></td><td class='docblock-short'><p>64-bit signed integer, encoded in LEB128 (can be 1-9 bytes length).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.VarUint1.html" title='parity_wasm::elements::VarUint1 struct'>VarUint1</a></td><td class='docblock-short'><p>VarUint1, 1-bit value (0/1).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.VarUint7.html" title='parity_wasm::elements::VarUint7 struct'>VarUint7</a></td><td class='docblock-short'><p>7-bit unsigned integer, encoded in LEB128 (always 1 byte length).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.VarUint32.html" title='parity_wasm::elements::VarUint32 struct'>VarUint32</a></td><td class='docblock-short'><p>Unsigned variable-length integer, limited to 32 bits,
represented by at most 5 bytes that may contain padding 0x80 bytes.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.VarUint64.html" title='parity_wasm::elements::VarUint64 struct'>VarUint64</a></td><td class='docblock-short'><p>Unsigned variable-length integer, limited to 64 bits,
represented by at most 9 bytes that may contain padding 0x80 bytes.</p>
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table><tr class='module-item'><td><a class="enum" href="enum.BlockType.html" title='parity_wasm::elements::BlockType enum'>BlockType</a></td><td class='docblock-short'><p>Block type which is basically <code>ValueType</code> + NoResult (to define blocks that have no return type)</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Error.html" title='parity_wasm::elements::Error enum'>Error</a></td><td class='docblock-short'><p>Deserialization/serialization error</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.External.html" title='parity_wasm::elements::External enum'>External</a></td><td class='docblock-short'><p>External to local binding.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ImportCountType.html" title='parity_wasm::elements::ImportCountType enum'>ImportCountType</a></td><td class='docblock-short'><p>Type of the import entry to count</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Instruction.html" title='parity_wasm::elements::Instruction enum'>Instruction</a></td><td class='docblock-short'><p>Instruction.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Internal.html" title='parity_wasm::elements::Internal enum'>Internal</a></td><td class='docblock-short'><p>Internal reference of the exported entry.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.RelocationEntry.html" title='parity_wasm::elements::RelocationEntry enum'>RelocationEntry</a></td><td class='docblock-short'><p>Relocation entry.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Section.html" title='parity_wasm::elements::Section enum'>Section</a></td><td class='docblock-short'><p>Section in the WebAssembly module.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.TableElementType.html" title='parity_wasm::elements::TableElementType enum'>TableElementType</a></td><td class='docblock-short'><p>Table element type.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Type.html" title='parity_wasm::elements::Type enum'>Type</a></td><td class='docblock-short'><p>Type definition in types section. Currently can be only of the function type.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ValueType.html" title='parity_wasm::elements::ValueType enum'>ValueType</a></td><td class='docblock-short'><p>Value type.</p>
</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
<table><tr class='module-item'><td><a class="trait" href="trait.Deserialize.html" title='parity_wasm::elements::Deserialize trait'>Deserialize</a></td><td class='docblock-short'><p>Deserialization from serial i/o.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.Serialize.html" title='parity_wasm::elements::Serialize trait'>Serialize</a></td><td class='docblock-short'><p>Serialization to serial i/o. Takes self by value to consume less memory
(parity-wasm IR is being partially freed by filling the result buffer).</p>
</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table><tr class='module-item'><td><a class="fn" href="fn.deserialize_buffer.html" title='parity_wasm::elements::deserialize_buffer fn'>deserialize_buffer</a></td><td class='docblock-short'><p>Deserialize deserializable type from buffer.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.deserialize_file.html" title='parity_wasm::elements::deserialize_file fn'>deserialize_file</a></td><td class='docblock-short'><p>Deserialize module from the file.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.peek_size.html" title='parity_wasm::elements::peek_size fn'>peek_size</a></td><td class='docblock-short'><p>Returns size of the module in the provided stream.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.serialize.html" title='parity_wasm::elements::serialize fn'>serialize</a></td><td class='docblock-short'><p>Create buffer with serialized value.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.serialize_to_file.html" title='parity_wasm::elements::serialize_to_file fn'>serialize_to_file</a></td><td class='docblock-short'><p>Serialize module to the file</p>
</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
<table><tr class='module-item'><td><a class="type" href="type.NameMap.html" title='parity_wasm::elements::NameMap type'>NameMap</a></td><td class='docblock-short'><p>A map from indices to names.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "parity_wasm";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>