Skip to content

Instance Method

withBytes(_:)

iOS 26.0+ iPadOS 26.0+ Mac Catalyst 26.0+ macOS 26.0+ tvOS 26.0+ visionOS 26.0+ watchOS 26.0+
Calls the given closure with the contents of underlying storage.
func withBytes<R, E>(_ body: (RawSpan) throws(E) -> R) throws(E) -> R where E : Error

Discussion

Note

Calling withBytes multiple times does not guarantee that the same span will be passed in every time.

Default Implementations

ContiguousBytes Implementations