pub struct NameRef(pub u16);Expand description
An index into the running function’s name list, which maps it to a
StrId.
Property instructions need two registers and a name in one eight-byte instruction, which leaves 16 bits for the name. Routing names through a per-function list (as Lua and V8 do with their per-function constant pools) keeps the module’s string table unbounded while each function may still name 65,536 distinct properties.
§Examples
use bytecode_lang::NameRef;
assert_eq!(NameRef(0).to_string(), "n0");Tuple Fields§
§0: u16Implementations§
Trait Implementations§
impl Copy for NameRef
impl Eq for NameRef
Source§impl Ord for NameRef
impl Ord for NameRef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for NameRef
impl PartialOrd for NameRef
impl StructuralPartialEq for NameRef
Auto Trait Implementations§
impl Freeze for NameRef
impl RefUnwindSafe for NameRef
impl Send for NameRef
impl Sync for NameRef
impl Unpin for NameRef
impl UnsafeUnpin for NameRef
impl UnwindSafe for NameRef
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