1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Copyright 2025 Peter Garfield Bower
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! # **TimeUnits Module** - *Arrow Datetime Units*
//!
//! Defines time and interval units used by temporal arrays in Minarrow.
//!
//! `TimeUnit` standardises second, millisecond, microsecond, nanosecond, and day resolution
//! across `DatetimeArray32` and `DatetimeArray64`.
//! `IntervalUnit` specifies year–month, day–time, or month–day–nanosecond intervals
//! for representing durations or periods in `DatetimeArray` values.
//!
//! Both integrate with Apache Arrow’s native types for FFI compatibility.
use ;
/// # TimeUnit
///
/// Unified time unit enumeration.
///
/// ## Purpose
/// - Combines time units for both `DatetimeArray32` and `DatetimeArray64`.
/// - Confirm time since epoch units, or a raw duration value *(depending on the `ArrowType`
/// that's attached to `Field` during `FieldArray` construction)*.
/// - Avoids proliferating variants that require explicit handling throughout match statements.
///
/// ## Behaviour
/// - Unit values are stored on the `DatetimeArray`, enabling variant-specific logic.
/// - When transmitted over FFI, an `Apache Arrow`- produces compatible native format.
/// # IntervalUnit
///
/// Inner Arrow discriminant for representing interval types
///
/// ## Usage
/// Attach via `ArrowType` to `Field` when your `DatetimeArray<T>`
/// T-integer represents an interval, rather than an epoch value.
/// Then, it will materialise as an `Interval` *Apache Arrow* type
/// when sent over FFI.