> For the complete documentation index, see [llms.txt](https://docs.aera.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aera.finance/the-protocol/core/pipeline.md).

# Pipeline

Library for handling pipeline operations that copy and paste data between operations

*Uses bit manipulation and assembly for efficient data movement*

## Functions

### pipe

Process pipeline operations by copying data between operations

```solidity
function pipe(bytes memory data, CalldataReader reader, bytes[] memory results)
    internal
    pure
    returns (CalldataReader);
```

**Parameters**

| Name      | Type             | Description                                      |
| --------- | ---------------- | ------------------------------------------------ |
| `data`    | `bytes`          | The calldata to modify                           |
| `reader`  | `CalldataReader` | Current position in the calldata                 |
| `results` | `bytes[]`        | Array of previous operation results to copy from |

**Returns**

| Name     | Type             | Description                                                          |
| -------- | ---------------- | -------------------------------------------------------------------- |
| `<none>` | `CalldataReader` | Updated CalldataReader position after processing pipeline operations |

## Errors

### Aera\_\_CopyOffsetOutOfBounds

Thrown when trying to copy from an invalid position in source data

```solidity
error Aera__CopyOffsetOutOfBounds();
```

### Aera\_\_PasteOffsetOutOfBounds

Thrown when trying to paste to an invalid position in target data

```solidity
error Aera__PasteOffsetOutOfBounds();
```
