Skip to main content

CodeValue

Struct CodeValue 

Source
#[repr(C)]
pub struct CodeValue { pub tag: CodeTag, pub heap: c_int, pub number: f64, pub str: *const c_char, pub boolean: c_int, pub items: *mut c_void, pub keys: *mut *const c_char, pub len: i64, }

Fields§

§tag: CodeTag§heap: c_int§number: f64§str: *const c_char§boolean: c_int§items: *mut c_void

CODE_ARRAY: element buffer; CODE_OBJECT: value buffer — both strided at CODE_VALUE_SLOT_SIZE, addressed via slot_at.

§keys: *mut *const c_char

CODE_OBJECT only, parallel to items.

§len: i64

Implementations§

Source§

impl CodeValue

Source

pub fn zeroed() -> Self

An all-zero value — tag Number, 0.0, not heap-owned. Bit-for-bit what CodeValue x = {0}; produces in C, and the required starting state before passing &mut to any constructor below (each one calls code_release on out first, exactly like the C ABI expects).

Trait Implementations§

Source§

impl Default for CodeValue

Source§

fn default() -> Self

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

impl Send for CodeValue

Source§

impl Sync for CodeValue

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> 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 = !

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.