pub struct ExprArenaCell { /* private fields */ }Expand description
Parallel-safe owner used by crate::Expr handles.
Ordinary construction writes the canonical arena. Indexed batch builders temporarily route expression operations to worker-local forks and merge the resulting nodes in deterministic index order.
Implementations§
Source§impl ExprArenaCell
impl ExprArenaCell
pub fn new(arena: ExprArena) -> Self
pub const fn model_id(&self) -> ModelId
Sourcepub fn borrow(&self) -> ExprArenaSnapshot<'_>
pub fn borrow(&self) -> ExprArenaSnapshot<'_>
Take a cheap immutable snapshot of the canonical arena.
The returned value is not a live read lock. Later writes are isolated by copy-on-write and are not visible through this snapshot.
§Panics
Panics if an indexed batch is active. Snapshot reads cannot observe a worker-local fork and would otherwise wait on the canonical arena lock held by the batch.
Sourcepub fn borrow_mut(&self) -> ExprArenaWriteGuard<'_>
pub fn borrow_mut(&self) -> ExprArenaWriteGuard<'_>
Mutably borrow the canonical expression arena.
§Panics
Panics if an indexed batch is active, because its worker-local forks must see a stable canonical snapshot until they are merged, or if this thread already holds a write guard for this arena.