CustomDump Documentation

Function custom​Dump(_:​to:​name:​indent:​max​Depth:​)

@discardableResult
public func customDump<T, TargetStream>(
  _ value: T,
  to target: inout TargetStream,
  name: String? = nil,
  indent: Int = 0,
  maxDepth: Int = .max
) -> T where TargetStream: TextOutputStream  

Dumps the given value's contents using its mirror to the specified output stream.

Parameters

value T

The value to output to the target stream.

target inout Target​Stream

The stream to use for writing the contents of value.

name String?

A label to use when writing the contents of value. When nil is passed, the label is omitted. The default is nil.

indent Int

The number of spaces to use as an indent for each line of the output. The default is 0.

max​Depth Int

The maximum depth to descend when writing the contents of a value that has nested components. The default is Int.max.

Returns

The instance passed as value.