[][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>,
}

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.

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 Sync for Used

impl Send for Used

impl Unpin for Used

impl UnwindSafe for Used

impl RefUnwindSafe for Used

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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