[−][src]Struct neon::context::CallContext
A view of the JS engine in the context of a function call.
The type parameter T is the type of the this-binding.
Implementations
impl<'a, T: This> CallContext<'a, T>[src]
pub fn kind(&self) -> CallKind[src]
Indicates whether the function was called via the JavaScript [[Call]] or [[Construct]] semantics.
pub fn len(&self) -> i32[src]
Indicates the number of arguments that were passed to the function.
pub fn argument_opt(&mut self, i: i32) -> Option<Handle<'a, JsValue>>[src]
Produces the ith argument, or None if i is greater than or equal to self.len().
pub fn argument<V: Value>(&mut self, i: i32) -> JsResult<'a, V>[src]
Produces the ith argument and casts it to the type V, or throws an exception if i is greater than or equal to self.len() or cannot be cast to V.
pub fn this(&mut self) -> Handle<'a, T>[src]
Produces a handle to the this-binding.
Trait Implementations
impl<'a, T: This> Context<'a> for CallContext<'a, T>[src]
fn lock(&self) -> Lock[src]
fn borrow<'c, V, T, F>(&self, v: &'c Handle<V>, f: F) -> T where
V: Value,
&'c V: Borrow,
F: for<'b> FnOnce(Ref<'b, <&'c V as Borrow>::Target>) -> T, [src]
V: Value,
&'c V: Borrow,
F: for<'b> FnOnce(Ref<'b, <&'c V as Borrow>::Target>) -> T,
fn borrow_mut<'c, V, T, F>(&self, v: &'c mut Handle<V>, f: F) -> T where
V: Value,
&'c mut V: BorrowMut,
F: for<'b> FnOnce(RefMut<'b, <&'c mut V as Borrow>::Target>) -> T, [src]
V: Value,
&'c mut V: BorrowMut,
F: for<'b> FnOnce(RefMut<'b, <&'c mut V as Borrow>::Target>) -> T,
fn execute_scoped<T, F>(&self, f: F) -> T where
F: for<'b> FnOnce(ExecuteContext<'b>) -> T, [src]
F: for<'b> FnOnce(ExecuteContext<'b>) -> T,
fn compute_scoped<V, F>(&self, f: F) -> JsResult<'a, V> where
V: Value,
F: for<'b, 'c> FnOnce(ComputeContext<'b, 'c>) -> JsResult<'b, V>, [src]
V: Value,
F: for<'b, 'c> FnOnce(ComputeContext<'b, 'c>) -> JsResult<'b, V>,
fn boolean(&mut self, b: bool) -> Handle<'a, JsBoolean>[src]
fn number<T: Into<f64>>(&mut self, x: T) -> Handle<'a, JsNumber>[src]
fn string<S: AsRef<str>>(&mut self, s: S) -> Handle<'a, JsString>[src]
fn try_string<S: AsRef<str>>(&mut self, s: S) -> StringResult<'a>[src]
fn null(&mut self) -> Handle<'a, JsNull>[src]
fn undefined(&mut self) -> Handle<'a, JsUndefined>[src]
fn empty_object(&mut self) -> Handle<'a, JsObject>[src]
fn empty_array(&mut self) -> Handle<'a, JsArray>[src]
fn array_buffer(&mut self, size: u32) -> JsResult<'a, JsArrayBuffer>[src]
fn buffer(&mut self, size: u32) -> JsResult<'a, JsBuffer>[src]
fn global(&mut self) -> Handle<'a, JsObject>[src]
fn throw<'b, T: Value, U>(&mut self, v: Handle<'b, T>) -> NeonResult<U>[src]
fn error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>[src]
fn type_error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>[src]
fn range_error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>[src]
fn throw_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>[src]
fn throw_type_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>[src]
fn throw_range_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>[src]
impl<'a, T: This> UnwindSafe for CallContext<'a, T>[src]
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for CallContext<'a, T>
impl<'a, T> !Send for CallContext<'a, T>
impl<'a, T> !Sync for CallContext<'a, T>
impl<'a, T> Unpin for CallContext<'a, T> where
T: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,