use crate::utils::*;
#[derive(Clone, Debug)]
#[repr(transparent)]
pub struct Null {
inner: emlite::Val,
}
impl Null {
pub const VALUE: Null = Null {
inner: emlite::Val::null(),
};
#[inline]
pub fn is_null(&self) -> bool {
true
}
}
bind!(Null);
impl crate::prelude::DynCast for Null {
#[inline]
fn instanceof(_val: &emlite::Val) -> bool {
false
}
#[inline]
fn unchecked_from_val(v: emlite::Val) -> Self {
v.as_::<Self>() }
#[inline]
fn unchecked_from_val_ref(v: &emlite::Val) -> &Self {
unsafe { &*(v as *const emlite::Val as *const Self) }
}
#[inline]
fn unchecked_from_val_mut(v: &mut emlite::Val) -> &mut Self {
unsafe { &mut *(v as *mut emlite::Val as *mut Self) }
}
}