# 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();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aera.finance/the-protocol/core/pipeline.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
