Struct wasmprinter::Printer [−][src]
pub struct Printer { /* fields omitted */ }
Expand description
Context used for printing a WebAssembly binary.
This is largely only required if you’d like to register custom printers for custom sections in a wasm binary.
Implementations
Creates a new Printer
object that’s ready to start printing wasm
binaries to strings.
Registers a custom printer
function to get invoked whenever a custom
section of name section
is seen.
This can be used to register printers into a textual format for custom sections, such as by emitting annotations and/or other textual references (maybe coments!)
By default all custom sections are ignored for the text format.
The printer
function provided takes three arguments:
- A
&mut Printer
, or where to print results to - A
usize
offset which is the start of the offset for the custom section - A byte slice which is the actual contents of the custom section.
Gets the output result of this Printer
, or where all output is going.
Prints a WebAssembly binary into a String
This function takes an entire wasm
binary blob and will print it to
the WebAssembly Text Format and return the result as a String
.
Prints a function index specified, using the identifier for the function
from the name
section if it was present.
This will either print $foo
or idx
as a raw integer.