Contents

append(_:as:_:)

Appends the given value’s bytes to this span’s bytes.

Declaration

mutating func append<T>(_ value: T, as type: T.Type, _ byteOrder: ByteOrder) where T : BitwiseCopyable, T : ConvertibleToBytes, T : FixedWidthInteger

Parameters

  • value:

    The value to store as raw bytes.

  • type:

    The type of the instance to store.

  • byteOrder:

    The order in which the bytes will be encoded to the span.

Discussion

There must be at least MemoryLayout<T>.size bytes available in the span.