StoragePath

public protocol StoragePath : Sendable

Protocol that provides a closure to resolve the storage path.

  • Tag: StoragePath

Note

Sendable because paths are stored on storage requests, which cross task boundaries. The resolve requirement is @Sendable for the same reason: without it a conformer could satisfy a Sendable protocol with a closure capturing unsynchronized state, which would make the conformance meaningless. Both types in this file already supply @Sendable closures; the requirement now says so, which is source-breaking only for an external conformer that was supplying a non-Sendable one — exactly the case the guarantee needs to exclude.
  • Declaration

    Swift

    associatedtype Input
  • Declaration

    Swift

    var resolve: @Sendable (Input) -> String { get }

Available where Self == StringStoragePath

  • fromString(_:) Extension method

    Declaration

    Swift

    static func fromString(_ path: String) -> Self

Available where Self == IdentityIDStoragePath

  • fromIdentityID(_:) Extension method

    Note

    @preconcurrency so a Swift 5 consumer passing an actor-isolated resolver gets a warning rather than a hard error from the @Sendable IdentityIDPathResolver.

    Declaration

    Swift

    @preconcurrency
    static func fromIdentityID(_ identityIdPathResolver: @escaping IdentityIDPathResolver) -> Self