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 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.
Trait Implementations§
Source§impl<'a> Default for EncodeOptions<'a>
impl<'a> Default for EncodeOptions<'a>
Source§fn default() -> EncodeOptions<'a>
fn default() -> EncodeOptions<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for EncodeOptions<'a>
impl<'a> RefUnwindSafe for EncodeOptions<'a>
impl<'a> Send for EncodeOptions<'a>
impl<'a> Sync for EncodeOptions<'a>
impl<'a> Unpin for EncodeOptions<'a>
impl<'a> UnwindSafe for EncodeOptions<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more