# KeyValue<TKey, TValue>

> A key-value pair.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Collections.LowLevel.Unsafe](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public struct KeyValue<TKey, TValue> where TKey : unmanaged, IEquatable<TKey> where TValue : unmanaged
```

## Remarks

Used for enumerators.

## Properties

| Property                                                                                      | Description              |
| --------------------------------------------------------------------------------------------- | ------------------------ |
| [Key](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/keyvalue2/key.md)     | The key.                 |
| [Value](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/keyvalue2/value.md) | Value of key/value pair. |

## Static Properties

| Property                                                                                    | Description          |
| ------------------------------------------------------------------------------------------- | -------------------- |
| [Null](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/keyvalue2/null.md) | An invalid KeyValue. |

## Methods

| Method                                                                                                    | Description                 |
| --------------------------------------------------------------------------------------------------------- | --------------------------- |
| [GetKeyValue](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/keyvalue2/getkeyvalue.md) | Gets the key and the value. |
