pub struct Mutator {
pub tid: u16,
pub rec: Arc<ThreadRecord>,
/* private fields */
}Fields§
§tid: u16§rec: Arc<ThreadRecord>Implementations§
Source§impl Mutator
impl Mutator
Sourcepub fn new(rec: Arc<ThreadRecord>) -> Self
pub fn new(rec: Arc<ThreadRecord>) -> Self
Creates the context for an already-registered thread.
Sourcepub fn heap_ptr(&self) -> *mut LocalHeap
pub fn heap_ptr(&self) -> *mut LocalHeap
Raw pointer to the allocator, for registration with the collector.
Sourcepub fn release_pages(&mut self)
pub fn release_pages(&mut self)
Returns the thread’s pages to the global pool (on thread exit, in native state).
Sourcepub fn scope<R>(&mut self, f: impl FnOnce(&mut Mutator) -> R) -> R
pub fn scope<R>(&mut self, f: impl FnOnce(&mut Mutator) -> R) -> R
Runs f with a handle scope; handles rooted inside are released afterwards.
pub fn root(&mut self, v: Value) -> Handle
pub fn get(&self, h: Handle) -> Value
pub fn set(&mut self, h: Handle, v: Value)
Sourcepub fn handle_values(&self) -> &[Value]
pub fn handle_values(&self) -> &[Value]
Root values for the GC (called while this thread is stopped).
Sourcepub fn handles_ptr(&self) -> *const Vec<Value>
pub fn handles_ptr(&self) -> *const Vec<Value>
Pointer to the handle stack, for root sources that must not borrow the mutator.
pub fn alloc_raw(&mut self, size: usize, cls: &'static Class) -> *mut Header
pub fn alloc_instance(&mut self, cls: &'static Class) -> Value
pub fn alloc_str(&mut self, s: &str) -> Value
Sourcepub fn int_from_big(&mut self, b: BigInt) -> Value
pub fn int_from_big(&mut self, b: BigInt) -> Value
Allocates a big integer, or returns a small int if it fits.
pub fn int(&mut self, i: i64) -> Value
pub fn alloc_list(&mut self, items: Vec<Value>) -> Value
pub fn alloc_dict(&mut self, table: DictTable) -> Value
pub fn alloc_set(&mut self, table: DictTable) -> Value
pub fn alloc_tuple(&mut self, items: &[Value]) -> Value
pub fn alloc_closure(&mut self, func: u32, caps: &[Value]) -> Value
pub fn alloc_cell(&mut self, v: Value) -> Value
pub fn alloc_string_builder(&mut self, s: String) -> Value
pub fn alloc_mutex(&mut self, v: Value) -> Value
pub fn alloc_atomic(&mut self, v: Value) -> Value
pub fn alloc_channel(&mut self, capacity: usize) -> Value
pub fn alloc_thread(&mut self) -> Value
pub fn alloc_native(&mut self, data: Box<dyn NativeData>) -> Value
pub fn alloc_range( &mut self, first: Value, last: Value, exclusive: bool, ) -> Value
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Mutator
impl !Sync for Mutator
impl !UnwindSafe for Mutator
impl Freeze for Mutator
impl Unpin for Mutator
impl UnsafeUnpin for Mutator
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