pub struct Used {
pub tables: HashSet<Id<Table>>,
pub types: HashSet<Id<Type>>,
pub funcs: HashSet<Id<Function>>,
pub globals: HashSet<Id<Global>>,
pub memories: HashSet<Id<Memory>>,
pub elements: HashSet<Id<Element>>,
pub data: HashSet<Id<Data>>,
}Expand description
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>>The module’s used tables.
types: HashSet<Id<Type>>The module’s used types.
funcs: HashSet<Id<Function>>The module’s used functions.
globals: HashSet<Id<Global>>The module’s used globals.
memories: HashSet<Id<Memory>>The module’s used memories.
elements: HashSet<Id<Element>>The module’s used passive element segments.
data: HashSet<Id<Data>>The module’s used passive data segments.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Used
impl RefUnwindSafe for Used
impl Send for Used
impl Sync for Used
impl Unpin for Used
impl UnwindSafe for Used
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more