Encoding

Enum Encoding 

Source
pub enum Encoding<'a> {
    LC0(i8),
    LC1(i8),
    LC2(i16),
    LC4(i32),
    LCF(f32),
    LV0(u8),
    LV1(u8),
    GV0(u8),
    GV1(u8),
    GV2(u16),
    LCS(&'a str),
}
Expand description

Parameter encoding

LCx: Local constant value

LVx: Local variable address

GVx: Global variable address

GV4 & LV4 & LV2 are unusable in direct command

There is utils::auto_const for automatic integer encoding

Variants§

§

LC0(i8)

5-bits constant (-32 - 31)

§

LC1(i8)

7-bits constant (-127 - 127)

§

LC2(i16)

15-bits constant (-32_767 - 32_767)

§

LC4(i32)

31-bits constant (-2_147_483_647 - 2_147_483_647)

§

LCF(f32)

IEEE-754 single precision constant

§

LV0(u8)

5-bits local address

§

LV1(u8)

7-bits local address

§

GV0(u8)

5-bits global address (-32 - 31)

§

GV1(u8)

7-bits global address (-127 - 127)

§

GV2(u16)

15-bits global address (-32_767 - 32_767)

§

LCS(&'a str)

String (auto zero-terminated)

Auto Trait Implementations§

§

impl<'a> Freeze for Encoding<'a>

§

impl<'a> RefUnwindSafe for Encoding<'a>

§

impl<'a> Send for Encoding<'a>

§

impl<'a> Sync for Encoding<'a>

§

impl<'a> Unpin for Encoding<'a>

§

impl<'a> UnwindSafe for Encoding<'a>

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> 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, 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.