Home Explore Blog CI



nushell

16th chunk of `contributor-book/plugin_protocol_reference.md`
45ff37b126ae5bf51b85d90168ddfa01cb23dfaba8e665fc0000000100000fa8
| **val**  | double          |
| **span** | [`Span`](#span) |

Example:

```nu
36.4
```

```json
{
  "Float": {
    "val": 36.4,
    "span": {
      "start": 8040,
      "end": 8044
    }
  }
}
```

### `Filesize`

A quantity of bytes, internally a 64-bit signed integer representing the number of bytes. This is pretty-printed to the user with a more human scale, e.g. `32.4 MiB`.

| Field    | Type            |
| -------- | --------------- |
| **val**  | integer         |
| **span** | [`Span`](#span) |

Example:

```nu
32.4MiB
```

```json
{
  "Filesize": {
    "val": 33973248,
    "span": {
      "start": 7740,
      "end": 7747
    }
  }
}
```

### `Duration`

A duration of time, internally a 64-bit signed integer representing the number of nanoseconds. This is pretty-printed to the user with a more human scale, e.g. `8sec 375ms 604µs 528ns`.

| Field    | Type            |
| -------- | --------------- |
| **val**  | integer         |
| **span** | [`Span`](#span) |

Example:

```nu
8375604528ns
```

```json
{
  "Duration": {
    "val": 8375604528,
    "span": {
      "start": 181462,
      "end": 181465
    }
  }
}
```

### `Date`

A date/time value, including the time zone, represented in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format. This is printed to the user according to their locale.

| Field    | Type            |
| -------- | --------------- |
| **val**  | string          |
| **span** | [`Span`](#span) |

Example:

```nu
1996-12-19T16:39:57-08:00
```

```json
{
  "Date": {
    "val": "1996-12-19T16:39:57-08:00",
    "span": {
      "start": 181525,
      "end": 181528
    }
  }
}
```

### `Range`

A range of values.

| Field    | Type            |
| -------- | --------------- |
| **val**  | `Range`         |
| **span** | [`Span`](#span) |

`Range` has two variants, `IntRange` and `FloatRange`:

#### `IntRange`

| Field     | Type            |
| --------- | --------------- |
| **start** | integer         |
| **step**  | integer         |
| **end**   | `Bound` integer |

Examples:

```nu
0..
```

```json
{
  "Range": {
    "val": {
      "IntRange": {
        "start": 0,
        "step": 1,
        "end": "Unbounded"
      }
    },
    "span": {
      "start": 1380,
      "end": 1383
    }
  }
}
```

```nu
7..10
```

```json
{
  "Range": {
    "val": {
      "IntRange": {
        "start": 7,
        "step": 1,
        "end": { "Included": 10 }
      }
    },
    "span": {
      "start": 1380,
      "end": 1385
    }
  }
}
```

```nu
7..<10
```

```json
{
  "Range": {
    "val": {
      "IntRange": {
        "start": 7,
        "step": 1,
        "end": { "Excluded": 10 }
      }
    },
    "span": {
      "start": 1380,
      "end": 1386
    }
  }
}
```

```nu
0..64..128
```

```json
{
  "Range": {
    "val": {
      "IntRange": {
        "start": 0,
        "step": 64,
        "end": { "Included": 128 }
      }
    },
    "span": {
      "start": 1380,
      "end": 1390
    }
  }
}
```

#### `FloatRange`

Identical to [`IntRange`](#intrange) but for floats instead.

| Field     | Type           |
| --------- | -------------- |
| **start** | double         |
| **step**  | double         |
| **end**   | `Bound` double |

Example:

```nu
7.5..10.5
```

```json
{
  "Range": {
    "val": {
      "FloatRange": {
        "start": 7.5,
        "step": 1,
        "end": { "Included": 10.5 }
      }
    },
    "span": {
      "start": 1380,
      "end": 1389
    }
  }
}
```

### `String`

A UTF-8 string.

| Field    | Type            |
| -------- | --------------- |
| **val**  | string          |
| **span** | [`Span`](#span) |

Example:

```nu
"Hello, nu!"
```

```json
{
  "String": {
    "val": "Hello, nu!",
    "span": {
      "start": 8990,
      "end": 9002
    }
  }
}
```

### `Glob`

A filesystem glob, selecting multiple files or directories depending on the expansion of wildcards.

If `no_expand` is true, the expansion of wildcards is disabled and this just acts as a literal path.

| Field         | Type            |

Title: Nu Value Types: Duration, Date, Range, String, and Glob
Summary
This section continues the description of Nu `Value` types. It details `Duration` (nanoseconds), `Date` (RFC 3339 format), `Range` (IntRange and FloatRange with start, step, and end bounds), `String` (UTF-8 string), and introduces `Glob` (filesystem glob with optional wildcard expansion). Each type includes field descriptions, Nu examples, and corresponding JSON representations.