---
sidebar_position: 4
sidebar_label: Shard
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# `Shard` structure

## Definition

`IndexerShard` struct is ephemeral structure, there is no such entity in `nearcore`. We've introduces it as a container in [`near-indexer-primitives`](https://crates.io/crates/near-indexer-primitives). This container includes:

- shard ID
- [Chunk](chunk.mdx) that might be absent
- [ExecutionOutcomes](execution_outcome.mdx) for [Receipts](receipt.mdx) (these belong to a Shard not to a [Chunk](chunk.mdx) or a [Block](block.mdx))
- [StateChanges](state_change.mdx) for a Shard

## `IndexerShard`

<Tabs>
  <TabItem value="rust" label="Rust">

```rust links=1
pub struct IndexerShard {
    pub shard_id: types::ShardId,
    pub chunk: Option<IndexerChunkView>,
    pub receipt_execution_outcomes: Vec<IndexerExecutionOutcomeWithReceipt>,
    pub state_changes: views::StateChangesView,
}
```

  </TabItem>
  <TabItem value="typescript" value="TypeScript">

```ts links=1
export interface Shard {
  shard_id: number;
  chunk?: Chunk;
  receiptExecutionOutcomes: ExecutionOutcomeWithReceipt[];
  stateChanges: StateChange[];
};
```

  </TabItem>
</Tabs>
