[][src]Struct walrus::passes::Used

pub struct Used {
    pub tables: HashSet<Id<Table>, BuildIdHasher>,
    pub types: HashSet<Id<Type>, BuildIdHasher>,
    pub funcs: HashSet<Id<Function>, BuildIdHasher>,
    pub globals: HashSet<Id<Global>, BuildIdHasher>,
    pub memories: HashSet<Id<Memory>, BuildIdHasher>,
    pub elements: HashSet<Id<Element>, BuildIdHasher>,
    pub data: HashSet<Id<Data>, BuildIdHasher>,
    pub locals: HashMap<Id<Function>, HashSet<Id<Local>, BuildIdHasher>, BuildIdHasher>,
}

Finds the things within a module that are used.

This is useful for implementing something like a linker's --gc-sections so that our emitted .wasm binaries are small and don't contain things that are not used.

Fields

tables: HashSet<Id<Table>, BuildIdHasher>

The module's used tables.

types: HashSet<Id<Type>, BuildIdHasher>

The module's used types.

funcs: HashSet<Id<Function>, BuildIdHasher>

The module's used functions.

globals: HashSet<Id<Global>, BuildIdHasher>

The module's used globals.

memories: HashSet<Id<Memory>, BuildIdHasher>

The module's used memories.

elements: HashSet<Id<Element>, BuildIdHasher>

The module's used passive element segments.

data: HashSet<Id<Data>, BuildIdHasher>

The module's used passive data segments.

locals: HashMap<Id<Function>, HashSet<Id<Local>, BuildIdHasher>, BuildIdHasher>

Locals used within functions

Methods

impl Used[src]

pub fn new<R>(module: &Module, roots: R) -> Used where
    R: IntoIterator<Item = ExportId>, 
[src]

Construct a new Used set for the given module.

Trait Implementations

impl Default for Used[src]

impl Debug for Used[src]

Auto Trait Implementations

impl Send for Used

impl Sync for Used

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]