Struct rustyscript::JsFunction
source · pub struct JsFunction<'a>(/* private fields */);
Expand description
A Serializable javascript function, that can be stored and called later Must live as long as the runtime it was birthed from
Implementations§
source§impl<'a> JsFunction<'a>
impl<'a> JsFunction<'a>
sourcepub fn to_v8(&self) -> Local<'_, Function>
pub fn to_v8(&self) -> Local<'_, Function>
Extract the underlying v8::Function object
Use Runtime::call_stored_function
instead!
sourcepub fn to_v8_global(&self, scope: &mut HandleScope<'a>) -> Global<Function>
pub fn to_v8_global(&self, scope: &mut HandleScope<'a>) -> Global<Function>
Extract the underlying v8::Function object as a global
Use Runtime::call_stored_function
instead!
Trait Implementations§
source§impl<'de> Deserialize<'de> for JsFunction<'_>
impl<'de> Deserialize<'de> for JsFunction<'_>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> Hash for JsFunction<'a>
impl<'a> Hash for JsFunction<'a>
source§impl<'a> PartialEq for JsFunction<'a>
impl<'a> PartialEq for JsFunction<'a>
source§fn eq(&self, other: &JsFunction<'a>) -> bool
fn eq(&self, other: &JsFunction<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for JsFunction<'_>
impl Serialize for JsFunction<'_>
impl<'a> Eq for JsFunction<'a>
impl<'a> StructuralEq for JsFunction<'a>
impl<'a> StructuralPartialEq for JsFunction<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for JsFunction<'a>
impl<'a> !Send for JsFunction<'a>
impl<'a> !Sync for JsFunction<'a>
impl<'a> Unpin for JsFunction<'a>
impl<'a> UnwindSafe for JsFunction<'a>
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.