Skip to main content

NanValue

Struct NanValue 

Source
pub struct NanValue(/* private fields */);

Implementations§

Source§

impl NanValue

Source

pub fn eq_in<T: ArenaTypes>(self, other: Self, arena: &Arena<T>) -> bool

Source

pub fn hash_in<T: ArenaTypes, H: Hasher>(self, state: &mut H, arena: &Arena<T>)

Source

pub fn repr<T: ArenaTypes>(self, arena: &Arena<T>) -> String

Source

pub fn display<T: ArenaTypes>(self, arena: &Arena<T>) -> Option<String>

Source§

impl NanValue

Source

pub const FALSE: NanValue

Source

pub const TRUE: NanValue

Source

pub const UNIT: NanValue

Source

pub const NONE: NanValue

Source

pub const EMPTY_LIST: NanValue

Source

pub const EMPTY_MAP: NanValue

Source

pub const EMPTY_VECTOR: NanValue

Source

pub const EMPTY_STRING: NanValue

Source

pub fn encode(tag: u64, payload: u64) -> Self

Source

pub fn is_nan_boxed(self) -> bool

Source

pub fn tag(self) -> u64

Source

pub fn payload(self) -> u64

Source

pub fn new_float(f: f64) -> Self

Source

pub fn as_float(self) -> f64

Source

pub fn new_int_inline(i: i64) -> Self

Source

pub fn new_int_arena(arena_index: u32) -> Self

Source

pub fn new_int<T: ArenaTypes>(i: i64, arena: &mut Arena<T>) -> Self

Source

pub fn as_int<T: ArenaTypes>(self, arena: &Arena<T>) -> i64

Source

pub fn inline_int_payload(self) -> Option<u64>

Source

pub fn inline_int_value(self) -> Option<i64>

Source

pub fn new_bool(b: bool) -> Self

Source

pub fn as_bool(self) -> bool

Source

pub fn plain_immediate_payload(self) -> Option<u64>

Source

pub fn wrapper_kind(self) -> u64

Source

pub fn wrapper_inline_inner(self) -> Option<NanValue>

Source

pub fn wrapper_parts<T: ArenaTypes>( self, arena: &Arena<T>, ) -> Option<(u64, NanValue)>

Source

pub fn new_some(inner_index: u32) -> Self

Source

pub fn new_ok(inner_index: u32) -> Self

Source

pub fn new_err(inner_index: u32) -> Self

Source

pub fn wrapper_index(self) -> u32

Source

pub fn wrapper_inner<T: ArenaTypes>(self, arena: &Arena<T>) -> NanValue

Source

pub fn new_some_value<T: ArenaTypes>( inner: NanValue, arena: &mut Arena<T>, ) -> Self

Source

pub fn new_ok_value<T: ArenaTypes>( inner: NanValue, arena: &mut Arena<T>, ) -> Self

Source

pub fn new_err_value<T: ArenaTypes>( inner: NanValue, arena: &mut Arena<T>, ) -> Self

Source

pub fn new_string(arena_index: u32) -> Self

Source

pub fn small_string(self) -> Option<NanString<'static>>

Source

pub fn new_string_value<T: ArenaTypes>(s: &str, arena: &mut Arena<T>) -> Self

Source

pub fn new_list(arena_index: u32) -> Self

Source

pub fn new_tuple(arena_index: u32) -> Self

Source

pub fn new_map(arena_index: u32) -> Self

Source

pub fn new_vector(arena_index: u32) -> Self

Source

pub fn new_record(arena_index: u32) -> Self

Source

pub fn new_variant(arena_index: u32) -> Self

Source

pub fn symbol_kind(self) -> u64

Source

pub fn symbol_index(self) -> u32

Source

pub fn new_nullary_variant(symbol_index: u32) -> Self

Source

pub fn try_new_inline_variant(ctor_id: u32, inner: NanValue) -> Option<Self>

Source

pub fn inline_variant_ctor_id(self) -> u32

Source

pub fn inline_variant_inner(self) -> NanValue

Source

pub fn new_fn(arena_index: u32) -> Self

Source

pub fn new_builtin(arena_index: u32) -> Self

Source

pub fn new_namespace(arena_index: u32) -> Self

Source

pub fn arena_index(self) -> u32

Source

pub fn heap_index(self) -> Option<u32>

Source

pub fn with_heap_index(self, index: u32) -> Self

Source

pub fn is_float(self) -> bool

Source

pub fn is_int(self) -> bool

Source

pub fn is_bool(self) -> bool

Source

pub fn is_unit(self) -> bool

Source

pub fn is_none(self) -> bool

Source

pub fn is_some(self) -> bool

Source

pub fn is_ok(self) -> bool

Source

pub fn is_err(self) -> bool

Source

pub fn is_string(self) -> bool

Source

pub fn string_eq<T: ArenaTypes>(self, other: NanValue, arena: &Arena<T>) -> bool

Source

pub fn is_list(self) -> bool

Source

pub fn is_record(self) -> bool

Source

pub fn is_fn(self) -> bool

Source

pub fn is_variant(self) -> bool

Source

pub fn is_inline_variant(self) -> bool

Source

pub fn is_map(self) -> bool

Source

pub fn is_vector(self) -> bool

Source

pub fn is_empty_vector_immediate(self) -> bool

Source

pub fn is_tuple(self) -> bool

Source

pub fn is_builtin(self) -> bool

Source

pub fn is_namespace(self) -> bool

Source

pub fn is_empty_list_immediate(self) -> bool

Source

pub fn is_empty_map_immediate(self) -> bool

Source

pub fn type_name(self) -> &'static str

Source

pub fn variant_ctor_id<T: ArenaTypes>(self, arena: &Arena<T>) -> Option<u32>

Source

pub fn variant_parts<T: ArenaTypes>( self, arena: &Arena<T>, ) -> Option<(u32, u16, &[NanValue])>

Source

pub fn variant_single_field<T: ArenaTypes>(self, arena: &Arena<T>) -> NanValue

Source

pub fn inline_variant_info<T: ArenaTypes>( self, arena: &Arena<T>, ) -> Option<(u32, u16, NanValue)>

Source

pub fn bits(self) -> u64

Source

pub fn from_bits(bits: u64) -> Self

Source

pub fn map_key_hash<T: ArenaTypes>(self, arena: &Arena<T>) -> u64

Source

pub fn map_key_hash_deep<T: ArenaTypes>(self, arena: &Arena<T>) -> u64

Structural hash that respects eq_in for every value shape: two equal heap values (variants/tuples/records/lists/etc.) always produce the same u64 regardless of arena layout. Used by Map when the key type is anything beyond inline scalars.

Trait Implementations§

Source§

impl Clone for NanValue

Source§

fn clone(&self) -> NanValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NanValue

Source§

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

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

impl Copy for NanValue

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.