---
title: "update(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelbufferresource/update(_:)"
---

# update(_:)

Updates the buffer synchronously on the CPU. The buffer is only valid for the lifetime of the callback.

## Declaration

```swift
final func update<R, E>(_ body: @_lifetime(0: copy 0) (inout MutableRawSpan) throws(E) -> R) throws(E) -> R where E : Error, R : ~Copyable
```

## Parameters

- `body`: A closure that receives a mutable span over the buffer’s bytes for in-place modification.

## Discussion

Discussion note: Any error thrown by body.
