Skip to main content

CoreState

Struct CoreState 

Source
pub struct CoreState { /* private fields */ }
Expand description

Per-shard mutable Core state (Step 2a, D220-EXEC: still exactly ONE shard — behaviour-identical with the pre-B-2 single CoreState; Step 2b keys a per-[crate::state_cell::ShardKey] map of these). All mutable Core state, behind one parking_lot::Mutex.

Architecture history. Q2 (2026-05-09) split four wave-scoped cross-partition aggregation fields out into a separate parking_lot::Mutex<CrossPartitionState> on Core. Q-beyond Sub-slice 1 (D108, 2026-05-09) eliminated CrossPartitionState entirely — its four fields moved to per-thread WaveState thread_local in crate::batch. Sub-slice 2 + 3 moved 8 more wave-scoped fields the same way. /qa F1+F2 (2026-05-10) reverted in_tick and currently_firing to CoreState; currently_firing stays here (cross-thread P13 set_deps check, /qa F2), but in_tick was re-keyed per-(Core, thread) into the crate::batch::IN_TICK_OWNED thread_local (D047, 2026-05-15) and then collapsed to a one-Core-per-OS-thread Cell<u64> slot (D252, S5, 2026-05-19) — the actor-model invariant locks “one Core per OS thread” so a single-generation slot suffices, with cross-Core same-thread nesting panicking fail-loud at BatchGuard::claim_in_tick. See docs/rust-port-decisions.md.

The D1 patch (2026-05-09) moved Slice G’s tier3_emitted_this_wave set to a per-thread thread-local in crate::batch (was briefly per-partition under Q3 v1; that placement was vulnerable to mid-wave cross-thread set_deps partition splits — see docs/porting-deferred.md “Per-partition state-shard refactor” closing summary). Q-beyond will continue the shape decomposition by sharding most of the remaining fields per-partition.

Trait Implementations§

Source§

impl Drop for CoreState

Release every binding-side refcount share owned by this CoreState when the last Core clone drops the inner Mutex.

Without this, every retained handle in cache / terminal Error / dep_terminals Error / pause-buffer-payload would leak in the binding registry until process exit. Production bindings (napi-rs, pyo3, wasm-bindgen) all maintain handle-ref maps that grow unbounded without this cleanup.

Safe to call during panic unwinding — BindingBoundary::release_handle is the only call, and a panicking binding during cleanup would already have been a problem in normal operation.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.