pub struct Printer { /* private fields */ }
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 comments!)

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.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.