write(_:)

Provides thread-safe scoped mutable access to protected value

Protected.swift:30
func write<V>(_ body: (inout T) throws -> V) rethrows -> V

Parameters

body

The closure to be called for scoped access

Returns

The return value of the closure