MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / Unit

Interface Unit

src/datetime.rs:75–83  ·  view source on GitHub ↗

Represents the [datetime units][datetime-units] supported by NumPy [datetime-units]: https://numpy.org/doc/stable/reference/arrays.datetime.html#datetime-units

Source from the content-addressed store, hash-verified

73///
74/// [datetime-units]: https://numpy.org/doc/stable/reference/arrays.datetime.html#datetime-units
75pub trait Unit: Send + Sync + Clone + Copy + PartialEq + Eq + Hash + PartialOrd + Ord {
76 /// The matching NumPy [datetime unit code][NPY_DATETIMEUNIT]
77 ///
78 /// [NPY_DATETIMEUNIT]: https://github.com/numpy/numpy/blob/4c60b3263ac50e5e72f6a909e156314fc3c9cba0/numpy/core/include/numpy/ndarraytypes.h#L276
79 const UNIT: NPY_DATETIMEUNIT;
80
81 /// The abbreviation used for debug formatting
82 const ABBREV: &'static str;
83}
84
85macro_rules! define_units {
86 ($($(#[$meta:meta])* $struct:ident => $unit:ident $abbrev:literal,)+) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected