Struct Scope

Source
pub struct Scope<'s> { /* private fields */ }
Expand description

Provides controlled access to the parameters passed to a callable.

Implementations§

Source§

impl<'s> Scope<'s>

Source

pub fn nargs(&self) -> usize

Returns the number of arguments that can still be consumed.

Source

pub fn pop_boolean(&mut self) -> bool

Pops the top of the stack as a boolean value.

Source

pub fn pop_boolean_with_pos(&mut self) -> (bool, LineCol)

Pops the top of the stack as a boolean value.

Source

pub fn pop_double(&mut self) -> f64

Pops the top of the stack as a double value.

Source

pub fn pop_double_with_pos(&mut self) -> (f64, LineCol)

Pops the top of the stack as a double value.

Source

pub fn pop_integer(&mut self) -> i32

Pops the top of the stack as an integer value.

Source

pub fn pop_integer_with_pos(&mut self) -> (i32, LineCol)

Pops the top of the stack as an integer value.

Source

pub fn pop_sep_tag(&mut self) -> ArgSep

Pops the top of the stack as a separator tag.

Source

pub fn pop_string(&mut self) -> String

Pops the top of the stack as a string value.

Source

pub fn pop_string_with_pos(&mut self) -> (String, LineCol)

Pops the top of the stack as a string value.

Source

pub fn pop_value_tag(&mut self) -> ValueTag

Pops the top of the stack as a value tag.

Source

pub fn pop_varref(&mut self) -> (SymbolKey, ExprType)

Pops the top of the stack as a variable reference.

Source

pub fn pop_varref_with_pos(&mut self) -> (SymbolKey, ExprType, LineCol)

Pops the top of the stack as a variable reference.

Source

pub fn return_any(self, value: Value) -> CallResult

Sets the return value of this function to value.

Source

pub fn return_boolean(self, value: bool) -> CallResult

Sets the return value of this function to the boolean value.

Source

pub fn return_double(self, value: f64) -> CallResult

Sets the return value of this function to the double value.

Source

pub fn return_integer(self, value: i32) -> CallResult

Sets the return value of this function to the integer value.

Source

pub fn return_string<S: Into<String>>(self, value: S) -> CallResult

Sets the return value of this function to the string value.

Trait Implementations§

Source§

impl<'s> Drop for Scope<'s>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'s> Freeze for Scope<'s>

§

impl<'s> RefUnwindSafe for Scope<'s>

§

impl<'s> Send for Scope<'s>

§

impl<'s> Sync for Scope<'s>

§

impl<'s> Unpin for Scope<'s>

§

impl<'s> !UnwindSafe for Scope<'s>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.