feat: EvalState.weak_ref()
(cherry picked from commit d7a72c82ebfbfbb1b58fa15044b63648b2109260)
This commit is contained in:
parent
e0dead151e
commit
01c9d0b2d3
2 changed files with 57 additions and 2 deletions
|
|
@ -39,6 +39,8 @@ pub struct StoreWeak {
|
|||
}
|
||||
impl StoreWeak {
|
||||
/// Upgrade the weak reference to a proper [Store].
|
||||
///
|
||||
/// If no normal reference to the [Store] is around anymore elsewhere, this fails by returning `None`.
|
||||
pub fn upgrade(&self) -> Option<Store> {
|
||||
self.inner.upgrade().map(|inner| Store {
|
||||
inner,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue