Generic Function

dump(_:name:indent:maxDepth:maxItems:)

Dumps the given object’s contents using its mirror to standard output. 与えられたオブジェクトの内容をそれのミラーを使って標準出力にダンプします。

Declaration 宣言

@discardableResult func dump<T>(_ value: T, name: String? = nil, indent: Int = 0, maxDepth: Int = .max, maxItems: Int = .max) -> T

Parameters パラメータ

value

The value to output to the target stream. targetストリームに出力することになる値。

name

A label to use when writing the contents of value. When nil is passed, the label is omitted. The default is nil. valueの内容を書き込むときに使うラベル。nilが渡される場合、ラベルは省かれます。省略時にはnilです。

indent

The number of spaces to use as an indent for each line of the output. The default is 0. 出力の各行のひとつの字下げとして使われる空白の数。省略時には0です。

maxDepth

The maximum depth to descend when writing the contents of a value that has nested components. The default is Int.max. 入れ子になった構成要素を持つ値の内容を書き出す時に下る最大の深さ。省略時にはInt.maxです。

maxItems

The maximum number of elements for which to write the full contents. The default is Int.max. 完全な内容を書き出すための最大要素数。省略時にはInt.maxです。

Return Value 戻り値

The instance passed as value. valueとして渡されるインスタンス。

See Also 参照

Printing and Dumping プリントとダンプ