-
Breaking changes:
BoxScope::newnow accepts aScopeobject that is unsafe to construct directly. Safe use ofnolifenow requires using thescope!({})macro. This is to fix a soundness issue that can occur when aFrozenFutureis polled directly, without giving back control to nolife's executor. The macros ensure that a frozen future is always immediately awaited. To update your usages, replace:
let scope = BoxScope::new(|time_capsule| async { time_capsule.freeze_forever(&mut some_ref()).await });
with:
let scope = BoxScope::new(scope!({ freeze_forever!(&mut some_ref()) }));
Check the documentation of the
scope!macro for details.- The lifetime of the
Familytype passed to the closure inBoxScope::enterchanged to fix a soundness issue. - Removed
DynBoxScope, useBoxScope::new_dyninstead.
-
Improvement: dynamic scope no longer boxes the future, as it is already behind a level of indirection in a
BoxScope.
Thanks to @steffahn for opening the above issues and helping fix them ❤️
- Fix documentation links
- Add a beautifully handcrafted icon
- Add
TimeCapsule::freeze_foreveras a convenience method - Add
DynBoxScope::pinas a convenience method.
- Add
DynBoxScopetype for common case of erased future
-
Breaking changes:
- Tightened
BoxScope::entersignature so that the frozen reference cannot escape, fixing a soundness issue. Replace:
let frozen_ref = scope.enter(identity); use_frozen_ref(frozen_ref, refs_from_environment);
with:
scope.enter(|frozen_ref| use_frozen_ref(frozen_ref, refs_from_environment));
Note that
BoxScope::entersignature was adjusted to allow passing references from the environment to its closure argument. If your code specifically relied on storing the escaped reference, it cannot be ported to the new version. However, it was likely unsound.- Removed
StackScopes, hidScopeandSingleFamily. - Removed closed scopes again 🤡. Replace:
let scope = WhateverScope::new(); let mut scope = scope.open(producer); scope.enter(consumer);
with:
let mut scope = WhateverScope::new(producer); scope.enter(consumer);
- Tightened
- Breaking change: separated closed and opened scope. Replace:
let mut scope = WhateverScope::new(...);
scope.open(...);
scope.enter(...);with:
let scope = WhateverScope::new(...); // removed the mut
let mut scope = scope.open(...); // re-assign the scope
scope.enter(...); // unchanged- Fix a panic that would occur when dropping an unopened scope.
- Initial version