pub struct IsolatedContext { /* private fields */ }Expand description
The context an @isolated(any) async closure carries.
Such a closure is not two words of function and context — the isolation it
runs on has to travel with it, and Swift puts it in the context: a heap box
of an object header followed by an (any Actor)?. All-zero is nil, which
means nonisolated, which is what a closure written { } with no actor
context gets.
The refcount is the immortal pattern for the same reason ClosureCtx uses
it: SwiftUI stores the closure and releases it later, and this is not a real
Swift object to be freed.
Implementations§
Source§impl IsolatedContext
impl IsolatedContext
Sourcepub fn nonisolated() -> Self
pub fn nonisolated() -> Self
A context carrying no isolation.
Auto Trait Implementations§
impl !Send for IsolatedContext
impl !Sync for IsolatedContext
impl Freeze for IsolatedContext
impl RefUnwindSafe for IsolatedContext
impl Unpin for IsolatedContext
impl UnsafeUnpin for IsolatedContext
impl UnwindSafe for IsolatedContext
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