---
title: "replaceAdjacencies(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowleveldeformation/renormalizing-swift.struct/replaceadjacencies(_:)"
---

# replaceAdjacencies(_:)

Fills the adjacency buffer using the given closure.

## Declaration

```swift
func replaceAdjacencies<R>(_ body: @_lifetime(0: copy 0) (inout MutableRawSpan) -> R) throws(LowLevelDeformation.Error) -> R where R : ~Copyable
```

## Parameters

- `body`: A closure that receives a mutable span over the buffer.

## Return Value

Return Value The value returned by body.

## Discussion

Discussion After the closure returns, the framework validates every entry against the triangle count. An out-of-range entry causes a throw. note: If any entry is ≥ renormalizing.indexCount / 3.

## See Also

### Replacing geometry data

- [replaceTriangleIndices(_:)](realitykit/lowleveldeformation/renormalizing-swift.struct/replacetriangleindices(_:).md)
- [replaceAdjacencyEndIndices(_:)](realitykit/lowleveldeformation/renormalizing-swift.struct/replaceadjacencyendindices(_:).md)
