2019-09-06 15:57:44 -07:00

33 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 `wasmparser` crate."><meta name="keywords" content="rust, rustlang, rust-lang, wasmparser"><title>wasmparser - 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='../wasmparser/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate wasmparser</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all wasmparser's items</p></a><div class="block items"><ul><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'></p><script>window.sidebarCurrent = {name: 'wasmparser', ty: 'mod', relpath: '../'};</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/wasmparser/lib.rs.html#16-131' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>wasmparser</a></span></h1><div class='docblock'><p>A simple event-driven library for parsing WebAssembly binary files
(or streams).</p>
<p>The parser library reports events as they happend and only stores
parsing information for a brief period of time, making it very fast
and memory-efficient. The event-driven model, however, has some drawbacks.
If you need random access to the entire WebAssembly data-structure,
this is not the right library for you. You could however, build such
a data-structure using this library.</p>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.BinaryReader.html" title='wasmparser::BinaryReader struct'>BinaryReader</a></td><td class='docblock-short'><p>A binary reader of the WebAssembly structures and types.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.BinaryReaderError.html" title='wasmparser::BinaryReaderError struct'>BinaryReaderError</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.BrTable.html" title='wasmparser::BrTable struct'>BrTable</a></td><td class='docblock-short'><p>A br_table entries representation.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.CodeSectionReader.html" title='wasmparser::CodeSectionReader struct'>CodeSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Data.html" title='wasmparser::Data struct'>Data</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.DataSectionReader.html" title='wasmparser::DataSectionReader struct'>DataSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Element.html" title='wasmparser::Element struct'>Element</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ElementItems.html" title='wasmparser::ElementItems struct'>ElementItems</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ElementItemsReader.html" title='wasmparser::ElementItemsReader struct'>ElementItemsReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ElementSectionReader.html" title='wasmparser::ElementSectionReader struct'>ElementSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Export.html" title='wasmparser::Export struct'>Export</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ExportSectionReader.html" title='wasmparser::ExportSectionReader struct'>ExportSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.FuncType.html" title='wasmparser::FuncType struct'>FuncType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.FunctionBody.html" title='wasmparser::FunctionBody struct'>FunctionBody</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.FunctionSectionReader.html" title='wasmparser::FunctionSectionReader struct'>FunctionSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Global.html" title='wasmparser::Global struct'>Global</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.GlobalSectionReader.html" title='wasmparser::GlobalSectionReader struct'>GlobalSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.GlobalType.html" title='wasmparser::GlobalType struct'>GlobalType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Ieee32.html" title='wasmparser::Ieee32 struct'>Ieee32</a></td><td class='docblock-short'><p>An IEEE binary32 immediate floating point value, represented as a u32
containing the bitpattern.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Ieee64.html" title='wasmparser::Ieee64 struct'>Ieee64</a></td><td class='docblock-short'><p>An IEEE binary64 immediate floating point value, represented as a u64
containing the bitpattern.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Import.html" title='wasmparser::Import struct'>Import</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ImportSectionReader.html" title='wasmparser::ImportSectionReader struct'>ImportSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.InitExpr.html" title='wasmparser::InitExpr struct'>InitExpr</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.LinkingSectionReader.html" title='wasmparser::LinkingSectionReader struct'>LinkingSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.LocalName.html" title='wasmparser::LocalName struct'>LocalName</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.LocalsReader.html" title='wasmparser::LocalsReader struct'>LocalsReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.MemoryImmediate.html" title='wasmparser::MemoryImmediate struct'>MemoryImmediate</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.MemorySectionReader.html" title='wasmparser::MemorySectionReader struct'>MemorySectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.MemoryType.html" title='wasmparser::MemoryType struct'>MemoryType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ModuleReader.html" title='wasmparser::ModuleReader struct'>ModuleReader</a></td><td class='docblock-short'><p>Reads top-level WebAssembly file structure: header and sections.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.NameSectionReader.html" title='wasmparser::NameSectionReader struct'>NameSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Naming.html" title='wasmparser::Naming struct'>Naming</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.NamingReader.html" title='wasmparser::NamingReader struct'>NamingReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.OperatorValidatorConfig.html" title='wasmparser::OperatorValidatorConfig struct'>OperatorValidatorConfig</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.OperatorsReader.html" title='wasmparser::OperatorsReader struct'>OperatorsReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Parser.html" title='wasmparser::Parser struct'>Parser</a></td><td class='docblock-short'><p>The <code>Parser</code> type. A simple event-driven parser of WebAssembly binary
format. The <code>read(&amp;mut self)</code> is used to iterate through WebAssembly records.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ProducersField.html" title='wasmparser::ProducersField struct'>ProducersField</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ProducersFieldValue.html" title='wasmparser::ProducersFieldValue struct'>ProducersFieldValue</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ProducersSectionReader.html" title='wasmparser::ProducersSectionReader struct'>ProducersSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Range.html" title='wasmparser::Range struct'>Range</a></td><td class='docblock-short'><p>Bytecode range in the WebAssembly module.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Reloc.html" title='wasmparser::Reloc struct'>Reloc</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.RelocEntry.html" title='wasmparser::RelocEntry struct'>RelocEntry</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.RelocSectionReader.html" title='wasmparser::RelocSectionReader struct'>RelocSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ResizableLimits.html" title='wasmparser::ResizableLimits struct'>ResizableLimits</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Section.html" title='wasmparser::Section struct'>Section</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.SectionIterator.html" title='wasmparser::SectionIterator struct'>SectionIterator</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.SectionIteratorLimited.html" title='wasmparser::SectionIteratorLimited struct'>SectionIteratorLimited</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.TableSectionReader.html" title='wasmparser::TableSectionReader struct'>TableSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.TableType.html" title='wasmparser::TableType struct'>TableType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.TypeSectionReader.html" title='wasmparser::TypeSectionReader struct'>TypeSectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.V128.html" title='wasmparser::V128 struct'>V128</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ValidatingOperatorParser.html" title='wasmparser::ValidatingOperatorParser struct'>ValidatingOperatorParser</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ValidatingParser.html" title='wasmparser::ValidatingParser struct'>ValidatingParser</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ValidatingParserConfig.html" title='wasmparser::ValidatingParserConfig struct'>ValidatingParserConfig</a></td><td class='docblock-short'></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.CustomSectionKind.html" title='wasmparser::CustomSectionKind enum'>CustomSectionKind</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.DataKind.html" title='wasmparser::DataKind enum'>DataKind</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.ElementKind.html" title='wasmparser::ElementKind enum'>ElementKind</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.ExternalKind.html" title='wasmparser::ExternalKind enum'>ExternalKind</a></td><td class='docblock-short'><p>External types as defined <a href="https://webassembly.github.io/spec/core/syntax/types.html#external-types">here</a>.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ImportSectionEntryType.html" title='wasmparser::ImportSectionEntryType enum'>ImportSectionEntryType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.LinkingType.html" title='wasmparser::LinkingType enum'>LinkingType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.Name.html" title='wasmparser::Name enum'>Name</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.NameEntry.html" title='wasmparser::NameEntry enum'>NameEntry</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.NameType.html" title='wasmparser::NameType enum'>NameType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.Operator.html" title='wasmparser::Operator enum'>Operator</a></td><td class='docblock-short'><p>Instructions as defined <a href="https://webassembly.github.io/spec/core/binary/instructions.html">here</a>.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ParserInput.html" title='wasmparser::ParserInput enum'>ParserInput</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.ParserState.html" title='wasmparser::ParserState enum'>ParserState</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.RelocType.html" title='wasmparser::RelocType enum'>RelocType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.SectionCode.html" title='wasmparser::SectionCode enum'>SectionCode</a></td><td class='docblock-short'><p>Section code as defined <a href="https://webassembly.github.io/spec/core/binary/modules.html#sections">here</a>.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Type.html" title='wasmparser::Type enum'>Type</a></td><td class='docblock-short'><p>Types as defined <a href="https://webassembly.github.io/spec/core/syntax/types.html#types">here</a>.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.TypeOrFuncType.html" title='wasmparser::TypeOrFuncType enum'>TypeOrFuncType</a></td><td class='docblock-short'><p>Either a value type or a function 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.SectionReader.html" title='wasmparser::SectionReader trait'>SectionReader</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.SectionWithLimitedItems.html" title='wasmparser::SectionWithLimitedItems trait'>SectionWithLimitedItems</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.WasmDecoder.html" title='wasmparser::WasmDecoder trait'>WasmDecoder</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.WasmModuleResources.html" title='wasmparser::WasmModuleResources trait'>WasmModuleResources</a></td><td class='docblock-short'></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.validate.html" title='wasmparser::validate fn'>validate</a></td><td class='docblock-short'><p>Test whether the given buffer contains a valid WebAssembly module,
analogous to WebAssembly.validate in the JS API.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.validate_function_body.html" title='wasmparser::validate_function_body fn'>validate_function_body</a></td><td class='docblock-short'><p>Test whether the given buffer contains a valid WebAssembly function.
The resources parameter contains all needed data to validate the operators.</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.Result.html" title='wasmparser::Result type'>Result</a></td><td class='docblock-short'></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 = "wasmparser";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>