---
title: "withBytes(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/collectionofone/withbytes(_:)"
---

# withBytes(_:)

## Declaration

```swift
func withBytes<R, E>(_ body: (RawSpan) throws(E) -> R) throws(E) -> R where E : Error, R : ~Copyable
```
