Memory
public actor Memory<T> : Storage where T : Decodable, T : Encodable, T : Sendable
A storage for storing objects in memory, where T is the type of the object to be stored.
-
save(item:Asynchronous) Saves the given item in memory.
Declaration
Swift
public func save(item: T) async throwsParameters
itemThe item to save.
-
get()AsynchronousRetrieves the item from memory.
Declaration
Swift
public func get() async throws -> T?Return Value
The item if it exists,
nilotherwise. -
delete()AsynchronousDeletes the item from memory.
Declaration
Swift
public func delete() async throws