Summary: - Sources: Audit, Helpers, Migrations, Models, Protocols - Added symbols: struct AppVersionConditionalMigration - Removed symbols: struct AppVersionConditionalMigration, protocol ConditionalMigration Stats: - 29 files changed, 471 insertions(+), 25 deletions(-)
26 lines
983 B
Swift
26 lines
983 B
Swift
/// Defines the storage operations required by concrete backends.
|
|
///
|
|
/// Storage helpers conform to this protocol to provide a common API surface.
|
|
import Foundation
|
|
|
|
/// Abstraction for basic storage operations.
|
|
///
|
|
/// Conforming types persist and retrieve values described by a ``StorageKey``.
|
|
public protocol StorageProviding: Sendable {
|
|
/// Stores a value for the given key.
|
|
///
|
|
/// - Parameters:
|
|
/// - value: The value to store.
|
|
/// - key: The storage key describing where and how to store the value.
|
|
func set<Value>(_ value: Value, for key: StorageKey<Value>) async throws
|
|
/// Retrieves a value for the given key.
|
|
///
|
|
/// - Parameter key: The storage key to read.
|
|
/// - Returns: The stored value.
|
|
func get<Value>(_ key: StorageKey<Value>) async throws -> Value
|
|
/// Removes a value for the given key.
|
|
///
|
|
/// - Parameter key: The storage key to remove.
|
|
func remove<Value>(_ key: StorageKey<Value>) async throws
|
|
}
|