Skip to main content

GcNode

Enum GcNode 

Source
pub enum GcNode {
    ClosureFn(Weak<NativeFn>),
    EnvWrapper(Weak<Env>),
    EnvBindings(Weak<EnvBindings>),
    Thunk(Weak<Thunk>),
    Channel {
        weak: Weak<Channel>,
        id: ChannelId,
    },
    Promise {
        weak: Weak<AsyncPromise>,
        id: PromiseId,
    },
    MultiMethod(Weak<MultiMethod>),
    MutableArray(Weak<MutableArray>),
    MutableCell(Weak<MutableCell>),
}
Expand description

A registered cycle-birth candidate. Registered once at creation by the (cold) constructors of the only objects that can be born into cycles; upvalue cells and interior Value nodes are discovered during trace (via GcEdge), never registered.

Variants§

§

ClosureFn(Weak<NativeFn>)

A VM closure’s NativeFn wrapper (registered by make_closure).

§

EnvWrapper(Weak<Env>)

An env wrapper allocation, registered on first home-adoption. The wrapper (not just its bindings) is the candidate so a pass can reach the whole parent chain: a cycle that closes through an ANCESTOR env’s bindings (e.g. module code set!-ing a root binding to a closure homed in the module) is reachable from the home wrapper via parent edges even when no registered bindings map holds the closure.

§

EnvBindings(Weak<EnvBindings>)

An env’s bindings allocation (data-path registration; home adoption registers the wrapper above, which reaches the bindings anyway).

§

Thunk(Weak<Thunk>)

delay thunk (data-only cycles via forced).

§

Channel

Channel handle (data-only cycles via the runtime’s channel BUFFER, which lives in the ChannelRegistry, reached via the runtime interior hooks). The id is retained so a prune of a dead handle can also evict the registry record — the handle Weak alone cannot recover it once dead.

Fields

§

Promise

Promise handle (data-only cycles via the runtime’s SETTLED value, which lives in the PromiseRegistry, reached via the runtime interior hooks). The id is retained for the same dead-handle eviction reason.

§

MultiMethod(Weak<MultiMethod>)

Multimethod (data-only cycles via the method table).

§

MutableArray(Weak<MutableArray>)

Mutable array (data-only cycles via the element vector).

§

MutableCell(Weak<MutableCell>)

Mutable cell (data-only cycles via the value slot).

Auto Trait Implementations§

§

impl !RefUnwindSafe for GcNode

§

impl !Send for GcNode

§

impl !Sync for GcNode

§

impl !UnwindSafe for GcNode

§

impl Freeze for GcNode

§

impl Unpin for GcNode

§

impl UnsafeUnpin for GcNode

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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.