# SortJob<T, U>

> Returned by the SortJob methods of NativeSortExtension. Call Schedule to schedule the sorting.

## Definition

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

```csharp
public struct SortJob<T, U> where T : unmanaged where U : IComparer<T>
```

## Remarks

When `RegisterGenericJobType` is used on SortJob, to complete registration you must register `SortJob<T,U>.SegmentSort` and `SortJob<T,U>.SegmentSortMerge`.

## Fields

| Value                                                                          | Description          |
| ------------------------------------------------------------------------------ | -------------------- |
| [Comp](/engine/6000.7/script-reference/unity/collections/sortjob2/comp.md)     | Comparison function. |
| [Data](/engine/6000.7/script-reference/unity/collections/sortjob2/data.md)     | The data to sort.    |
| [Length](/engine/6000.7/script-reference/unity/collections/sortjob2/length.md) | The length to sort.  |

## Methods

| Method                                                                             | Description         |
| ---------------------------------------------------------------------------------- | ------------------- |
| [Schedule](/engine/6000.7/script-reference/unity/collections/sortjob2/schedule.md) | Schedules this job. |

## Structs

| Struct                                                                                                            | Description            |
| ----------------------------------------------------------------------------------------------------------------- | ---------------------- |
| [SortJob\<T, U>.SegmentSort](/engine/6000.7/script-reference/unity/collections/sortjob2/segmentsort.md)           | For internal use only. |
| [SortJob\<T, U>.SegmentSortMerge](/engine/6000.7/script-reference/unity/collections/sortjob2/segmentsortmerge.md) | For internal use only. |
