Instance Propertyswift 6.0.1Distributed

    asLocalActor

    Produces an erased any Actor reference to this known to be local distributed actor.

    iOS
    16.0+
    macOS
    13.0+
    tvOS
    16.0+
    watchOS
    9.0+
    @backDeployed(before: macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0)
    var asLocalActor: any Actor { get }

    Since this method is not distributed, it can only be invoked when the underlying distributed actor is known to be local, e.g. from a context that is isolated to this actor.

    Such reference can be used to work with APIs accepting isolated any Actor, as only a local distributed actor can be isolated on and may be automatically erased to such any Actor when calling methods implicitly accepting the caller’s actor isolation, e.g. by using the #isolation macro.

    Other members in extension

    Type members

    Instance members