---
title: "withUnsafeBytes(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/mutablespan/withunsafebytes(_:)"
---

# withUnsafeBytes(_:)

## Declaration

```swift
func withUnsafeBytes<E, Result>(_ body: (UnsafeRawBufferPointer) throws(E) -> Result) throws(E) -> Result where E : Error, Result : ~Copyable
```
