---
title: "withUnsafeMutablePointerToHeader(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/managedbufferpointer/withunsafemutablepointertoheader(_:)"
---

# withUnsafeMutablePointerToHeader(_:)

Call body with an UnsafeMutablePointer to the stored Header.

## Declaration

```swift
func withUnsafeMutablePointerToHeader<E, R>(_ body: (UnsafeMutablePointer<Header>) throws(E) -> R) throws(E) -> R where E : Error, R : ~Copyable
```

## Discussion

Discussion note: This pointer is valid only for the duration of the call to body. The caller is responsible for ensuring that the buffer is not being accessed anyone else while performing this call.

## See Also

### Accessing Buffer Contents

- [withUnsafeMutablePointerToElements(_:)](swift/managedbufferpointer/withunsafemutablepointertoelements(_:).md)
- [withUnsafeMutablePointers(_:)](swift/managedbufferpointer/withunsafemutablepointers(_:).md)
