pub struct NanValue(/* private fields */);Implementations§
Source§impl NanValue
impl NanValue
pub const FALSE: NanValue
pub const TRUE: NanValue
pub const UNIT: NanValue
pub const NONE: NanValue
pub const EMPTY_LIST: NanValue
pub const EMPTY_MAP: NanValue
pub const EMPTY_VECTOR: NanValue
pub const EMPTY_STRING: NanValue
pub fn new_float(f: f64) -> Self
pub fn as_float(self) -> f64
pub fn new_int_inline(i: i64) -> Self
pub fn new_int_arena(arena_index: u32) -> Self
pub fn new_int(i: i64, arena: &mut Arena) -> Self
pub fn as_int(self, arena: &Arena) -> i64
pub fn inline_int_value(self) -> Option<i64>
pub fn new_bool(b: bool) -> Self
pub fn as_bool(self) -> bool
pub fn new_some(inner_index: u32) -> Self
pub fn new_ok(inner_index: u32) -> Self
pub fn new_err(inner_index: u32) -> Self
pub fn wrapper_index(self) -> u32
pub fn wrapper_inner(self, arena: &Arena) -> NanValue
pub fn new_some_value(inner: NanValue, arena: &mut Arena) -> Self
pub fn new_ok_value(inner: NanValue, arena: &mut Arena) -> Self
pub fn new_err_value(inner: NanValue, arena: &mut Arena) -> Self
pub fn new_string(arena_index: u32) -> Self
pub fn new_string_value(s: &str, arena: &mut Arena) -> Self
pub fn new_list(arena_index: u32) -> Self
pub fn new_tuple(arena_index: u32) -> Self
pub fn new_map(arena_index: u32) -> Self
pub fn new_vector(arena_index: u32) -> Self
pub fn new_record(arena_index: u32) -> Self
pub fn new_variant(arena_index: u32) -> Self
pub fn new_nullary_variant(symbol_index: u32) -> Self
pub fn new_fn(arena_index: u32) -> Self
pub fn new_builtin(arena_index: u32) -> Self
pub fn new_namespace(arena_index: u32) -> Self
pub fn arena_index(self) -> u32
pub fn heap_index(self) -> Option<u32>
pub fn with_heap_index(self, index: u32) -> Self
pub fn is_float(self) -> bool
pub fn is_int(self) -> bool
pub fn is_bool(self) -> bool
pub fn is_unit(self) -> bool
pub fn is_none(self) -> bool
pub fn is_some(self) -> bool
pub fn is_ok(self) -> bool
pub fn is_err(self) -> bool
pub fn is_string(self) -> bool
Sourcepub fn string_eq(self, other: NanValue, arena: &Arena) -> bool
pub fn string_eq(self, other: NanValue, arena: &Arena) -> bool
Deep string equality: compare actual string content, not NanValue bits. Handles both inline short strings and arena-allocated strings.
pub fn is_list(self) -> bool
pub fn is_record(self) -> bool
pub fn is_fn(self) -> bool
pub fn is_variant(self) -> bool
pub fn is_map(self) -> bool
pub fn is_vector(self) -> bool
pub fn is_empty_vector_immediate(self) -> bool
pub fn is_tuple(self) -> bool
pub fn is_builtin(self) -> bool
pub fn is_namespace(self) -> bool
pub fn is_empty_list_immediate(self) -> bool
pub fn is_empty_map_immediate(self) -> bool
pub fn type_name(self) -> &'static str
pub fn variant_ctor_id(self, arena: &Arena) -> Option<u32>
pub fn variant_parts(self, arena: &Arena) -> Option<(u32, u16, &[NanValue])>
pub fn from_bits(bits: u64) -> Self
Sourcepub fn map_key_hash(self, arena: &Arena) -> u64
pub fn map_key_hash(self, arena: &Arena) -> u64
Content-based hash for use as map key. For inline values (int, float, bool), uses bits(). For arena-backed strings, hashes the string content so that two NanValues for the same string content produce the same key regardless of arena index.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NanValue
impl RefUnwindSafe for NanValue
impl Send for NanValue
impl Sync for NanValue
impl Unpin for NanValue
impl UnsafeUnpin for NanValue
impl UnwindSafe for NanValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more