Struct koto_parser::ConstantIndex [−][src]
Expand description
A 24 bit index for constants
Values are stored as little-endian 24 bit values.
Q: Why not just use a u32? A: Minimizing the memory footprint for a complex script with lots of constants seems like a healthy idea. Having a dedicated u24 type also forces the validity of a value to be checked when its first created; after creation an in-range index is guaranteed. Q: What if we need more than 2^24 constants in a script? A: Let’s wait and see, ConstantIndex can be transitioned to a u32 (along with the corresponding constant loading ops) if it really turns out to be necessary.
Tuple Fields
0: u8
1: u8
2: u8
Implementations
Trait Implementations
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ConstantIndex
impl Send for ConstantIndex
impl Sync for ConstantIndex
impl Unpin for ConstantIndex
impl UnwindSafe for ConstantIndex
Blanket Implementations
Mutably borrows from an owned value. Read more