pub struct GcScopeState<'heap> { /* private fields */ }Implementations§
Source§impl<'heap> GcScopeState<'heap>
impl<'heap> GcScopeState<'heap>
pub fn new(heap: &'heap mut GcHeap, partition_id: GcPartitionId) -> Self
pub fn partition_id(&self) -> GcPartitionId
pub fn heap(&self) -> &GcHeap
pub fn heap_mut(&mut self) -> &mut GcHeap
pub fn depth(&self) -> u8
pub fn count(&self) -> usize
Sourcepub fn parent(&self) -> Option<(&GcScopeState<'_>, u8)>
pub fn parent(&self) -> Option<(&GcScopeState<'_>, u8)>
get parent scope, and its level.
pub fn alloc_root<T: GcNode>( &self, payload: T, ) -> Result<GcRef<T>, (GcError, T)>
Sourcepub fn alloc_local<T: GcNode>(
&self,
payload: T,
) -> Result<GcRef<T>, (GcError, T)>
pub fn alloc_local<T: GcNode>( &self, payload: T, ) -> Result<GcRef<T>, (GcError, T)>
alloc a local node in scope.
pub fn add_non_local(&self, node: NonNull<GcHead>) -> bool
pub fn get_promote(&self) -> Option<NonNull<GcHead>>
Sourcepub fn set_promote(&self, node: Option<NonNull<GcHead>>)
pub fn set_promote(&self, node: Option<NonNull<GcHead>>)
Set a node to be promoted.
Promote means when the scope is dropped, the node will be added to upper scope.
Sourcepub fn flush(&self)
pub fn flush(&self)
clear and unprotect cached nodes. this behaves like to drop current scope, and start a new scope.
pub fn contains(&self, node: NonNull<GcHead>) -> bool
Trait Implementations§
Source§impl<'heap> Debug for GcScopeState<'heap>
impl<'heap> Debug for GcScopeState<'heap>
Auto Trait Implementations§
impl<'heap> !Freeze for GcScopeState<'heap>
impl<'heap> !RefUnwindSafe for GcScopeState<'heap>
impl<'heap> !Send for GcScopeState<'heap>
impl<'heap> !Sync for GcScopeState<'heap>
impl<'heap> Unpin for GcScopeState<'heap>
impl<'heap> UnsafeUnpin for GcScopeState<'heap>
impl<'heap> !UnwindSafe for GcScopeState<'heap>
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