Struct neon::context::CallContext [−][src]
pub struct CallContext<'a, T: This> { /* fields omitted */ }
An execution 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]
impl<'a, T: This> CallContext<'a, T>
[src]pub fn kind(&self) -> CallKind
[src]
Indicates whether the function was called with new
.
pub fn len(&self) -> i32
[src]
Indicates the number of arguments that were passed to the function.
pub fn is_empty(&self) -> bool
[src]
Indicates if no arguments were passed to the function.
pub fn argument_opt(&mut self, i: i32) -> Option<Handle<'a, JsValue>>
[src]
Produces the i
th 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 i
th 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]
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 try_catch<T, F>(&mut self, f: F) -> Result<T, Handle<'a, JsValue>> where
F: FnOnce(&mut Self) -> NeonResult<T>,
[src]
F: FnOnce(&mut Self) -> NeonResult<T>,
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<T: Value, U>(&mut self, v: Handle<'_, 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]
impl<'a, T: This> UnwindSafe for CallContext<'a, T>
[src]Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for CallContext<'a, T>
impl<'a, T> !RefUnwindSafe for CallContext<'a, T>
impl<'a, T> !Send for CallContext<'a, T>
impl<'a, T> !Send for CallContext<'a, T>
impl<'a, T> !Sync for CallContext<'a, T>
impl<'a, T> !Sync for CallContext<'a, T>
impl<'a, T> Unpin for CallContext<'a, T> where
T: Unpin,
impl<'a, T> Unpin for CallContext<'a, T> where
T: Unpin,