1use crate::utils::*;
2
3#[derive(Clone, Debug)]
5#[repr(transparent)]
6pub struct Null {
7 inner: emlite::Val,
8}
9
10impl Null {
11 pub const VALUE: Null = Null {
16 inner: emlite::Val::null(),
17 };
18
19 #[inline]
21 pub fn is_null(&self) -> bool {
22 true
23 }
24}
25
26bind!(Null);
27
28impl crate::prelude::DynCast for Null {
29 #[inline]
30 fn instanceof(_val: &emlite::Val) -> bool {
31 false
32 }
33 #[inline]
34 fn unchecked_from_val(v: emlite::Val) -> Self {
35 v.as_::<Self>() }
37 #[inline]
38 fn unchecked_from_val_ref(v: &emlite::Val) -> &Self {
39 unsafe { &*(v as *const emlite::Val as *const Self) }
40 }
41}