pub struct EncodeOptions<'a> { /* private fields */ }Expand description
Options that can be specified when encoding a component or a module to customize what the final binary looks like.
Methods such as Module::encode, Wat::encode, and
Component::encode will use the default options.
Implementations§
Source§impl<'a> EncodeOptions<'a>
impl<'a> EncodeOptions<'a>
Sourcepub fn new() -> EncodeOptions<'a>
pub fn new() -> EncodeOptions<'a>
Creates a new set of default encoding options.
Sourcepub fn dwarf(
&mut self,
file: &'a Path,
contents: &'a str,
style: GenerateDwarf,
) -> &mut Self
Available on crate feature dwarf only.
pub fn dwarf( &mut self, file: &'a Path, contents: &'a str, style: GenerateDwarf, ) -> &mut Self
dwarf only.Enables emission of DWARF debugging information in the final binary.
This method will use the file specified as the source file for the
*.wat file whose contents must also be supplied here. These are
used to calculate filenames/line numbers and are referenced from the
generated DWARF.
Sourcepub fn encode_module(&self, module: &mut Module<'_>) -> Result<Vec<u8>, Error>
pub fn encode_module(&self, module: &mut Module<'_>) -> Result<Vec<u8>, Error>
Encodes the given Module with these options.
For more information see Module::encode.
Sourcepub fn encode_component(
&self,
component: &mut Component<'_>,
) -> Result<Vec<u8>, Error>
Available on crate feature component-model only.
pub fn encode_component( &self, component: &mut Component<'_>, ) -> Result<Vec<u8>, Error>
component-model only.Encodes the given Component with these options.
For more information see Component::encode.
Sourcepub fn encode_wat(&self, wat: &mut Wat<'_>) -> Result<Vec<u8>, Error>
pub fn encode_wat(&self, wat: &mut Wat<'_>) -> Result<Vec<u8>, Error>
Encodes the given Wat with these options.
For more information see Wat::encode.