[][src]Trait walrus::CustomSection

pub trait CustomSection: WalrusAny + Debug + Send + Sync {
    fn name(&self) -> &str;
fn data(&self, ids_to_indices: &IdsToIndices) -> Cow<[u8]>; }

A trait for implementing custom sections.

Custom sections are added to a walrus::Module via my_module.custom_sections.add(my_custom_section).

Required methods

fn name(&self) -> &str

Get this custom section's name.

For example ".debug_info" for one of the DWARF custom sections or "name" for the names custom section.

fn data(&self, ids_to_indices: &IdsToIndices) -> Cow<[u8]>

Get the data payload for this custom section.

This should not include the section header with id=0, the custom section's name, or the count of how many bytes are in the payload. walrus will handle these for you.

Loading content...

Methods

impl dyn CustomSection[src]

pub fn into_any(self: Box<Self>) -> Box<dyn Any + Send + 'static>[src]

Convert this custom section to Box<Any> to do dynamic downcasting

pub fn as_any(&self) -> &(dyn Any + Send + Sync)[src]

Convert this custom section to &Any to do dynamic downcasting

pub fn as_any_mut(&mut self) -> &mut (dyn Any + Send + Sync)[src]

Convert this custom section to &mut Any to do dynamic downcasting

Implementors

impl CustomSection for RawCustomSection[src]

Loading content...