pub struct WeakCore { /* private fields */ }Expand description
Weak handle to a Core — does not contribute to strong refcount.
Constructed via Core::weak_handle; upgraded back to a strong
Core via WeakCore::upgrade. Used by long-lived binding-stored
closures (notably ProducerBuildFns registered via
[graphrefly_operators::ProducerBinding::register_producer_build])
to break the BenchBinding → registry → closure → strong-Core cycle
that would otherwise leak the entire graph state when a BenchCore
drops with active producer registrations.
Upgrade on each invocation; if the host Core was already dropped,
upgrade() returns None and the closure should no-op (the host
is being torn down, no work to do).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WeakCore
impl !RefUnwindSafe for WeakCore
impl Send for WeakCore
impl Sync for WeakCore
impl Unpin for WeakCore
impl UnsafeUnpin for WeakCore
impl !UnwindSafe for WeakCore
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