Skip to main content

GcScopeState

Struct GcScopeState 

Source
pub struct GcScopeState<'heap> { /* private fields */ }

Implementations§

Source§

impl<'heap> GcScopeState<'heap>

Source

pub fn new(heap: &'heap mut GcHeap, partition_id: GcPartitionId) -> Self

Source

pub fn partition_id(&self) -> GcPartitionId

Source

pub fn heap(&self) -> &GcHeap

Source

pub fn heap_mut(&mut self) -> &mut GcHeap

Source

pub fn depth(&self) -> u8

Source

pub fn count(&self) -> usize

Source

pub fn parent(&self) -> Option<(&GcScopeState<'_>, u8)>

get parent scope, and its level.

Source

pub fn alloc_root<T: GcNode>( &self, payload: T, ) -> Result<GcRef<T>, (GcError, T)>

Source

pub fn alloc_local<T: GcNode>( &self, payload: T, ) -> Result<GcRef<T>, (GcError, T)>

alloc a local node in scope.

Source

pub fn add_non_local(&self, node: NonNull<GcHead>) -> bool

Source

pub fn get_promote(&self) -> Option<NonNull<GcHead>>

Source

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.

Source

pub fn flush(&self)

clear and unprotect cached nodes. this behaves like to drop current scope, and start a new scope.

Source

pub fn contains(&self, node: NonNull<GcHead>) -> bool

Trait Implementations§

Source§

impl<'heap> Debug for GcScopeState<'heap>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'heap> Drop for GcScopeState<'heap>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.