---
title: "withUnsafeMutableBytes(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/mutablerawspan/withunsafemutablebytes(_:)"
---

# withUnsafeMutableBytes(_:)

## Declaration

```swift
mutating func withUnsafeMutableBytes<E, Result>(_ body: (UnsafeMutableRawBufferPointer) throws(E) -> Result) throws(E) -> Result where E : Error, Result : ~Copyable
```
