Add serde support
This commit is contained in:
parent
93f8051626
commit
89a91ae59c
@ -16,6 +16,7 @@ typenum = "1.16"
|
||||
num-traits = { version = "0.2", default-features = false }
|
||||
defmt = { version = "0.3", optional = true }
|
||||
fixed = { version = "1.23.0", optional = true }
|
||||
serde = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@ -23,3 +24,4 @@ defmt = ["dep:defmt"]
|
||||
fixed = ["dep:fixed"]
|
||||
std = ["num-traits/std"]
|
||||
nightly = []
|
||||
serde = ["dep:serde"]
|
||||
|
@ -21,6 +21,7 @@ use typenum::{int::Z0, op, Integer};
|
||||
use types::Unit;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct SiUnit<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela>
|
||||
where
|
||||
Second: Integer,
|
||||
|
Loading…
Reference in New Issue
Block a user