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) -> ExprArenaCell
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.
Trait Implementations§
Source§impl Debug for ExprArenaCell
impl Debug for ExprArenaCell
Source§impl Default for ExprArenaCell
impl Default for ExprArenaCell
Source§fn default() -> ExprArenaCell
fn default() -> ExprArenaCell
Auto Trait Implementations§
impl !Freeze for ExprArenaCell
impl !RefUnwindSafe for ExprArenaCell
impl Send for ExprArenaCell
impl Sync for ExprArenaCell
impl Unpin for ExprArenaCell
impl UnsafeUnpin for ExprArenaCell
impl UnwindSafe for ExprArenaCell
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more