diff --git a/napi/src/js_values/bigint.rs b/napi/src/js_values/bigint.rs index 1cfffe9a..6a034fd2 100644 --- a/napi/src/js_values/bigint.rs +++ b/napi/src/js_values/bigint.rs @@ -4,6 +4,7 @@ use std::ptr; use super::*; use crate::{check_status, sys, Result}; +#[derive(Clone, Copy)] pub struct JsBigint { pub(crate) raw: Value, pub word_count: usize, diff --git a/napi/src/js_values/boolean.rs b/napi/src/js_values/boolean.rs index 11ac20a3..55ef7f3b 100644 --- a/napi/src/js_values/boolean.rs +++ b/napi/src/js_values/boolean.rs @@ -4,6 +4,7 @@ use super::Value; use crate::check_status; use crate::{sys, Error, Result}; +#[derive(Clone, Copy)] pub struct JsBoolean(pub(crate) Value); impl JsBoolean { diff --git a/napi/src/js_values/mod.rs b/napi/src/js_values/mod.rs index 62040ae7..bf740c1b 100644 --- a/napi/src/js_values/mod.rs +++ b/napi/src/js_values/mod.rs @@ -61,8 +61,10 @@ pub use value_type::ValueType; pub struct JsUnknown(pub(crate) Value); +#[derive(Clone, Copy)] pub struct JsNull(pub(crate) Value); +#[derive(Clone, Copy)] pub struct JsSymbol(pub(crate) Value); pub struct JsExternal(pub(crate) Value); diff --git a/napi/src/js_values/number.rs b/napi/src/js_values/number.rs index b0cd3624..6e04c2cc 100644 --- a/napi/src/js_values/number.rs +++ b/napi/src/js_values/number.rs @@ -4,6 +4,7 @@ use super::Value; use crate::check_status; use crate::{sys, Error, Result}; +#[derive(Clone, Copy)] pub struct JsNumber(pub(crate) Value); impl JsNumber { diff --git a/napi/src/js_values/string/mod.rs b/napi/src/js_values/string/mod.rs index d2a2c5f5..25a00362 100644 --- a/napi/src/js_values/string/mod.rs +++ b/napi/src/js_values/string/mod.rs @@ -11,6 +11,7 @@ mod latin1; mod utf16; mod utf8; +#[derive(Clone, Copy)] pub struct JsString(pub(crate) Value); impl JsString { diff --git a/napi/src/js_values/undefined.rs b/napi/src/js_values/undefined.rs index 2d76bf79..53557ce5 100644 --- a/napi/src/js_values/undefined.rs +++ b/napi/src/js_values/undefined.rs @@ -1,3 +1,4 @@ use super::Value; +#[derive(Clone, Copy)] pub struct JsUndefined(pub(crate) Value);