pub struct Scope<'a> { /* private fields */ }Expand description
Arguments provided to a callable during its execution.
Implementations§
Source§impl<'a> Scope<'a>
impl<'a> Scope<'a>
Sourcepub fn data(&self) -> &[Option<ConstantDatum>]
pub fn data(&self) -> &[Option<ConstantDatum>]
Returns DATA values captured from the compiled source in encounter order.
Sourcepub fn get_pos(&self, arg: u8) -> LineCol
pub fn get_pos(&self, arg: u8) -> LineCol
Returns the source position of the argument at arg.
arg is the logical argument index, matching the N in scope.get_*(N).
Sourcepub fn get_boolean(&self, arg: u8) -> bool
pub fn get_boolean(&self, arg: u8) -> bool
Gets the boolean value of the argument at arg.
Sourcepub fn get_double(&self, arg: u8) -> f64
pub fn get_double(&self, arg: u8) -> f64
Gets the double value of the argument at arg.
Sourcepub fn get_integer(&self, arg: u8) -> i32
pub fn get_integer(&self, arg: u8) -> i32
Gets the integer value of the argument at arg.
Sourcepub fn get_ref(&self, arg: u8) -> RegisterRef<'_, 'a>
pub fn get_ref(&self, arg: u8) -> RegisterRef<'_, 'a>
Gets an immutable register reference from the argument at arg.
Sourcepub fn get_mut_ref(&mut self, arg: u8) -> RegisterRefMut<'_, 'a>
pub fn get_mut_ref(&mut self, arg: u8) -> RegisterRefMut<'_, 'a>
Gets a mutable register reference from the argument at arg.
Sourcepub fn get_string(&self, arg: u8) -> &str
pub fn get_string(&self, arg: u8) -> &str
Gets the string value of the argument at arg.
Sourcepub fn last_error(&self) -> Option<(LineCol, &str)>
pub fn last_error(&self) -> Option<(LineCol, &str)>
Returns the last error stored in the VM, if any.
Sourcepub fn return_boolean(self, b: bool) -> CallResult<()>
pub fn return_boolean(self, b: bool) -> CallResult<()>
Sets the return value of the function to b.
Always returns success. The returned value is only to support the idiomatic invocation
return scope.return_boolean(...).
Sourcepub fn return_double(self, d: f64) -> CallResult<()>
pub fn return_double(self, d: f64) -> CallResult<()>
Sets the return value of the function to d.
Always returns success. The returned value is only to support the idiomatic invocation
return scope.return_double(...).
Sourcepub fn return_integer(self, i: i32) -> CallResult<()>
pub fn return_integer(self, i: i32) -> CallResult<()>
Sets the return value of the function to i.
Always returns success. The returned value is only to support the idiomatic invocation
return scope.return_integer(...).
Sourcepub fn return_string<S: Into<String>>(self, s: S) -> CallResult<()>
pub fn return_string<S: Into<String>>(self, s: S) -> CallResult<()>
Sets the return value of the function to s.
Always returns success. The returned value is only to support the idiomatic invocation
return scope.return_string(...).