Skip to main content

EncodeHints

Struct EncodeHints 

Source
pub struct EncodeHints {
    pub wide: Option<bool>,
    pub bpf_call_local: Option<bool>,
}
Expand description

Per-call encoding hints that arches interpret in their own convention. Today the only hint is wide (x86’s short-vs-rel32 toggle); fixed-width arches (BPF, AArch64) ignore it.

Kept as a plain struct rather than per-method args so the trait can grow new hints without breaking every impl.

Fields§

§wide: Option<bool>

Force a wide-form encoding. On x86 this means “use rel32 even when rel8 would fit”; on BPF this is ignored (slot offsets are always one slot wide). None = arch picks.

§bpf_call_local: Option<bool>

BPF call-convention hint for encode_call: Some(true) requests call_local (opcode 0x8d, Linux eBPF style), Some(false) requests call_internal (opcode 0x85 src=1, Solana sBPF style), None defers to the codec’s default. Lifters that have the original opcode (e.g. the byte-drop pass with pinned bytes) set this so the regen matches the original encoding exactly. Ignored by non-BPF arches.

Implementations§

Source§

impl EncodeHints

Source

pub const fn wide(wide: bool) -> Self

Convenience: hints with wide set.

Source

pub fn wide_or(self, default: bool) -> bool

Resolve wide with a default for arches that need a bool. Most callers don’t care about the default; BPF ignores wide entirely, x86 falls back to “pick shortest.”

Trait Implementations§

Source§

impl Clone for EncodeHints

Source§

fn clone(&self) -> EncodeHints

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EncodeHints

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EncodeHints

Source§

fn default() -> EncodeHints

Returns the “default value” for a type. Read more
Source§

impl Copy for EncodeHints

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.