Protocol_Concurrency5.9.0
Actor
Common protocol to which all actors conform.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
protocol Actor : AnyActor
The Actor
protocol generalizes over all actor
types. Actor types implicitly conform to this protocol.
Supertypes
protocol AnyActor
Common marker protocol providing a shared “base” for both (local)
Actor
and (potentially remote)DistributedActor
types.protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Requirements
var unownedExecutor: UnownedSerialExecutor
Retrieve the executor for this actor as an optimized, unowned reference.
Citizens in _Concurrency
Members
func assertIsolated(() -> String, file: StaticString, line: UInt
) Performs an executor check in debug builds.
func assumeIsolated<T>((isolated Self) throws -> T, file: StaticString, line: UInt
) rethrows -> T A safe way to synchronously assume that the current execution context belongs to the passed in actor.
func preconditionIsolated(() -> String, file: StaticString, line: UInt
) Unconditionally if the current task is executing on the serial executor of the passed in
actor
, and if not crash the program offering information about the executor mismatch.