Skip to main content

ExactCellSelector

Trait ExactCellSelector 

Source
pub trait ExactCellSelector: Sealed + Copy {
    const WIRE_SIZE: u16;

    // Required method
    fn to_u32(self) -> u32;
}
Expand description

A selector whose runtime value and wire representation are guaranteed to agree with Hopper’s exact-cell Effect ABI.

The trait is sealed: aliases of the real unsigned primitives inherit the implementation, while signed integers and user-defined lookalikes cannot opt themselves in. Macro-generated code also checks WIRE_SIZE against the authored type spelling, catching primitive-shadowing aliases such as a local type u16 = u8 before a manifest can publish the wrong decoder width.

Required Associated Constants§

Source

const WIRE_SIZE: u16

Canonical fixed width of the selector on the instruction wire.

Required Methods§

Source

fn to_u32(self) -> u32

Convert to the compact value consumed by the write-policy gate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ExactCellSelector for u8

Source§

const WIRE_SIZE: u16 = 1

Source§

fn to_u32(self) -> u32

Source§

impl ExactCellSelector for u16

Source§

const WIRE_SIZE: u16 = 2

Source§

fn to_u32(self) -> u32

Source§

impl ExactCellSelector for u32

Source§

const WIRE_SIZE: u16 = 4

Source§

fn to_u32(self) -> u32

Implementors§