Contents

withUnsafeBytes(_:)

Call a function and pass a buffer representing the value of this instance’s Attachablevalue 2tnj5 property to it.

Declaration

borrowing func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) throws -> R

Parameters

  • body:

    A function to call. A temporary buffer containing a data representation of this instance is passed to it.

Return Value

Whatever is returned by body.

Discussion

The testing library uses this function when saving an attachment. This function calls the withUnsafeBytes(for:_:) function on this attachment’s attachableValue property.