pub struct JsPrimitive { /* private fields */ }Expand description
Built-in primitive operations
Implementations§
Source§impl JsPrimitive
impl JsPrimitive
Source§impl JsPrimitive
impl JsPrimitive
pub fn into_reference( val: JsPrimitive, env: Env, ) -> Result<Reference<JsPrimitive>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<JsPrimitive>>
Source§impl JsPrimitive
impl JsPrimitive
pub fn add() -> Self
pub fn sub() -> Self
pub fn mul() -> Self
pub fn div() -> Self
pub fn eq() -> Self
pub fn lt() -> Self
pub fn gt() -> Self
pub fn and() -> Self
pub fn or() -> Self
pub fn not() -> Self
pub fn cons() -> Self
pub fn car() -> Self
pub fn cdr() -> Self
pub fn identity() -> Self
Trait Implementations§
Source§impl FromNapiMutRef for JsPrimitive
impl FromNapiMutRef for JsPrimitive
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for JsPrimitive
impl FromNapiRef for JsPrimitive
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &JsPrimitive
impl FromNapiValue for &JsPrimitive
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut JsPrimitive
impl FromNapiValue for &mut JsPrimitive
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for JsPrimitive
impl ToNapiValue for JsPrimitive
Source§unsafe fn to_napi_value(env: napi_env, val: JsPrimitive) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: JsPrimitive) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &JsPrimitive
impl TypeName for &JsPrimitive
Source§impl TypeName for &mut JsPrimitive
impl TypeName for &mut JsPrimitive
Source§impl TypeName for JsPrimitive
impl TypeName for JsPrimitive
Source§impl ValidateNapiValue for &JsPrimitive
impl ValidateNapiValue for &JsPrimitive
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut JsPrimitive
impl ValidateNapiValue for &mut JsPrimitive
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for JsPrimitive
impl RefUnwindSafe for JsPrimitive
impl Send for JsPrimitive
impl Sync for JsPrimitive
impl Unpin for JsPrimitive
impl UnsafeUnpin for JsPrimitive
impl UnwindSafe for JsPrimitive
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more