pub enum Upvalue {
Immutable(ValueWord),
Mutable(Arc<RwLock<ValueWord>>),
}Expand description
Upvalue - a captured variable that can be shared between closures and their enclosing scope.
Most captures are immutable (the compiler never emits StoreClosure), so the
Immutable variant stores the ValueWord directly — no Arc, no RwLock, just an
8-byte clone. The Mutable variant preserves the old Arc<RwLock<ValueWord>>
path for the rare case where a capture is written to.
Variants§
Immutable(ValueWord)
Direct value — no lock, no Arc overhead. Clone is 8 bytes (or Arc bump for heap values).
Mutable(Arc<RwLock<ValueWord>>)
Shared mutable capture — used if StoreClosure is ever emitted.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Upvalue
impl RefUnwindSafe for Upvalue
impl Send for Upvalue
impl Sync for Upvalue
impl Unpin for Upvalue
impl UnsafeUnpin for Upvalue
impl UnwindSafe for Upvalue
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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