devela/num/
no.rs

1// devela::num::no
2//
3//! Allows the unit type [`()`] to represent the absence of a number.
4//
5
6/// Represents the absence of a number.
7///
8/// This can be used anywhere an implementation of [`Num`][super::Num] is expected,
9/// since it implements all the numeric traits, but does nothing.
10pub type NoNum = ();
11
12#[rustfmt::skip]
13impl super::Num for NoNum {
14    type Inner = ();
15    type Out = ();
16    type Rhs = ();
17
18    fn num_into(self) -> Self::Inner {}
19}
20
21#[cfg(_int··)]
22#[cfg_attr(feature = "nightly_doc", doc(cfg(_int··)))]
23impl super::NumInt for NoNum {
24    type OutI = ();
25}
26
27// #[cfg(feature = "geom")]
28// mod geom {
29//     use super::NoNum;
30//     use crate::{NumError, NumResult as Result, NumVector, Vector};
31//
32//     #[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "geom")))]
33//     impl NumVector for NoNum {
34//         type Scalar = ();
35//     }
36// }