pub trait Width:
Copy
+ Eq
+ Debug {
// Required methods
fn fixed(size: usize) -> Self;
fn size(self) -> Option<usize>;
// Provided method
fn operand(_table: TableId) -> Option<Self> { ... }
}Expand description
A width in the domain a width-inference pass works over.
Per-instruction planning knows every width as a concrete byte count. A producer resolving its own source bodies does not: a body’s local can take its width from a table operand whose export only exists once an instruction is decoded. Naming that dependency rather than dropping it is what makes the two passes agree — a pass that simply skipped the unknown would size the local from a later statement and reach a different answer.
Required Methods§
Provided Methods§
Sourcefn operand(_table: TableId) -> Option<Self>
fn operand(_table: TableId) -> Option<Self>
The width of the value a sub-table operand exports, if this domain can name it. Concrete domains cannot, and report the width as unknown.
Only a table operand is nameable. A decoder field substitutes an integer literal, and a literal deliberately establishes no width, so naming one would claim a width the per-instruction pass never infers.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".