pub struct RuntimeData { /* private fields */ }Implementations§
Source§impl RuntimeData
impl RuntimeData
pub fn new( memory_limit: usize, stack_size: usize, call_stack_size: usize, ) -> Result<Pin<Box<Self>>, ExecutionErrorPayload>
Sourcepub fn init_table(&mut self) -> Result<ObjectGcGuard, ExecutionErrorPayload>
pub fn init_table(&mut self) -> Result<ObjectGcGuard, ExecutionErrorPayload>
Initialize a new cao-lang table and return a pointer to it
pub fn init_native_function( &mut self, handle: Handle, ) -> Result<ObjectGcGuard, ExecutionErrorPayload>
pub fn init_function( &mut self, handle: Handle, arity: u32, ) -> Result<ObjectGcGuard, ExecutionErrorPayload>
pub fn init_closure( &mut self, handle: Handle, arity: u32, ) -> Result<ObjectGcGuard, ExecutionErrorPayload>
pub fn init_upvalue( &mut self, location: *mut Value, ) -> Result<ObjectGcGuard, ExecutionErrorPayload>
pub fn init_string( &mut self, payload: &str, ) -> Result<ObjectGcGuard, ExecutionErrorPayload>
pub fn free_object(&mut self, obj: NonNull<CaoLangObject>)
pub fn clear(&mut self)
pub fn set_memory_limit(&mut self, capacity: usize)
Sourcepub fn write_to_memory<T: Sized + Copy>(
&mut self,
val: T,
) -> Result<*mut T, ExecutionErrorPayload>
pub fn write_to_memory<T: Sized + Copy>( &mut self, val: T, ) -> Result<*mut T, ExecutionErrorPayload>
Types implementing Drop are not supported, thus the Copy bound
pub fn gc(&mut self)
pub fn capture_upvalue()
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuntimeData
impl !RefUnwindSafe for RuntimeData
impl !Send for RuntimeData
impl !Sync for RuntimeData
impl Unpin for RuntimeData
impl !UnwindSafe for RuntimeData
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