#[repr(C)]pub struct Context { /* private fields */ }Expand description
Opaque context structure that matches AtomVM’s internal representation
Trait Implementations§
Source§impl ContextExt for Context
impl ContextExt for Context
Source§unsafe fn set_platform_data(&mut self, data: *mut c_void)
unsafe fn set_platform_data(&mut self, data: *mut c_void)
Set platform-specific data in the context
Source§unsafe fn get_platform_data(&self) -> *mut c_void
unsafe fn get_platform_data(&self) -> *mut c_void
Get platform-specific data from the context
Source§unsafe fn set_user_data(&mut self, data: u64)
unsafe fn set_user_data(&mut self, data: u64)
Set user data (for storing Erlang terms as raw u64)
Source§unsafe fn get_user_data(&self) -> u64
unsafe fn get_user_data(&self) -> u64
Get user data
Source§unsafe fn get_platform_data_as<T>(&self) -> *mut T
unsafe fn get_platform_data_as<T>(&self) -> *mut T
Safely cast platform data to a specific type
Source§unsafe fn set_platform_data_box<T>(&mut self, data: Box<T>)
unsafe fn set_platform_data_box<T>(&mut self, data: Box<T>)
Safely set platform data from a boxed value
Source§unsafe fn take_platform_data_box<T>(&mut self) -> Option<Box<T>>
unsafe fn take_platform_data_box<T>(&mut self) -> Option<Box<T>>
Safely take ownership of platform data back as a box
Source§unsafe fn set_user_term(&mut self, term: Term)
unsafe fn set_user_term(&mut self, term: Term)
Set user data from a Term
Source§unsafe fn get_user_term(&self) -> Term
unsafe fn get_user_term(&self) -> Term
Get user data as a Term
Source§fn has_platform_data(&self) -> bool
fn has_platform_data(&self) -> bool
Check if platform data is set
Source§fn has_user_data(&self) -> bool
fn has_user_data(&self) -> bool
Check if user data is set
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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