Storage
public protocol Storage<T> : Sendable
Protocol to persist and retrieve Codable
instance.
-
Declaration
Swift
associatedtype T : Decodable, Encodable, Sendable
-
save(item:
Asynchronous) Saves the given item.
Declaration
Swift
func save(item: T) async throws
Parameters
item
The item to be saved.
-
get()
AsynchronousRetrieves the stored item.
Declaration
Swift
func get() async throws -> T?
Return Value
The stored item, or null if no item is stored.
-
delete()
AsynchronousDeletes the stored item.
Declaration
Swift
func delete() async throws