Structure
TransientStorage
public struct TransientStorage<Item: Storable>: Storage, IteratorProtocol
A struct
defining a Storage
avoiding caching all together.
Relationships
Conforms To
IteratorProtocol
Storage
Initializers
Methods
insert(_:)
@discardableResult
public func insert(_ item: Item) -> (inserted: Bool, memberAfterInsert: Item)
Insert a new item.
Parameters
Name | Type | Description |
---|---|---|
item | Item |
Some |
Returns
A tuple indicating whether a previous value existed, and what this value was.
removeValue(forKey:)
@discardableResult
public func removeValue(forKey key: Item.ID) -> Item?
Remove the associated item, if it exists.
Parameters
Name | Type | Description |
---|---|---|
key | Item.ID |
Some |
Throws
Any Error
.
Returns
The removed Item
, if it exists.