Storage Documentation

Structure Transient​Storage

public struct TransientStorage<Item: Storable>: Storage, IteratorProtocol  

A struct defining a Storage avoiding caching all together.

%141 TransientStorage TransientStorage Storage Storage TransientStorage->Storage IteratorProtocol IteratorProtocol TransientStorage->IteratorProtocol

Conforms To

IteratorProtocol
Storage

Initializers

init()

public init()  

Init.

Methods

insert(_:​)

@discardableResult
     public func insert(_ item: Item) -> (inserted: Bool, memberAfterInsert: Item)  

Insert a new item.

Parameters

item Item

Some Item.

Returns

A tuple indicating whether a previous value existed, and what this value was.

remove​Value(for​Key:​)

@discardableResult
     public func removeValue(forKey key: Item.ID) -> Item?  

Remove the associated item, if it exists.

Parameters

key Item.​ID

Some Item.ID.

Throws

Any Error.

Returns

The removed Item, if it exists.

remove​All()

public func removeAll()  

Remove all associated items.

next()

public func next() -> Item?  

Return the next value.

Returns

Some optional Item.