pub struct Procedure(/* private fields */);Expand description
The runtime representation of a Procedure, which can be either a user function or a continuation. Contains a reference to all of the environmental variables used in the body, along with a function pointer to the body of the procedure.
Implementations§
Source§impl Procedure
impl Procedure
Sourcepub fn new(
runtime: Runtime,
env: Vec<Value>,
func: impl Into<FuncPtr>,
num_required_args: usize,
variadic: bool,
) -> Self
pub fn new( runtime: Runtime, env: Vec<Value>, func: impl Into<FuncPtr>, num_required_args: usize, variadic: bool, ) -> Self
Creates a new procedure. func must be a BridgePtr or an
AsyncBridgePtr if async is enabled.
Sourcepub fn get_runtime(&self) -> Runtime
pub fn get_runtime(&self) -> Runtime
Get the runtime associated with the procedure
Sourcepub fn get_formals(&self) -> (usize, bool)
pub fn get_formals(&self) -> (usize, bool)
Return the number of required arguments and whether or not this function is variadic
Sourcepub fn get_debug_info(&self) -> Option<Arc<ProcDebugInfo>>
pub fn get_debug_info(&self) -> Option<Arc<ProcDebugInfo>>
Return the debug information associated with procedure, if it exists.
pub fn is_variable_transformer(&self) -> bool
Sourcepub fn is_continuation(&self) -> bool
pub fn is_continuation(&self) -> bool
Return whether or not the procedure is a continuation
Trait Implementations§
Source§impl From<Procedure> for UnpackedValue
impl From<Procedure> for UnpackedValue
Source§impl TryFrom<UnpackedValue> for Procedure
impl TryFrom<UnpackedValue> for Procedure
Auto Trait Implementations§
impl Freeze for Procedure
impl !RefUnwindSafe for Procedure
impl Send for Procedure
impl Sync for Procedure
impl Unpin for Procedure
impl !UnwindSafe for Procedure
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more