1
2use core::fmt;
5use super::UnitStruct;
6use super::NumLike;
7use super::chemical::*;
8use super::electromagnetic::*;
9use super::geometry::*;
10use super::mechanical::*;
11use super::nuclear::*;
12
13#[cfg(feature="serde")]
15use serde::{Serialize, Deserialize};
16#[cfg(feature="num-bigfloat")]
17use num_bigfloat;
18#[cfg(feature="num-complex")]
19use num_complex;
20
21
22
23#[derive(UnitStruct, Debug, Clone)]
25#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
26pub struct Amount<T: NumLike>{
27 pub mol: T
29}
30
31impl<T> Amount<T> where T: NumLike {
32
33 pub fn unit_name() -> &'static str { "moles" }
35
36 pub fn unit_symbol() -> &'static str { "mol" }
38
39 pub fn from_moles(moles: T) -> Self { Amount{mol: moles} }
44
45 pub fn to_moles(&self) -> T { self.mol.clone() }
47
48 pub fn from_mol(mol: T) -> Self { Amount{mol: mol} }
53
54 pub fn to_mol(&self) -> T { self.mol.clone() }
56
57}
58
59impl<T> fmt::Display for Amount<T> where T: NumLike {
60 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
61 write!(f, "{} {}", &self.mol, Self::unit_symbol())
62 }
63}
64
65impl<T> Amount<T> where T: NumLike+From<f64> {
66
67 pub fn to_count(&self) -> T {
71 return self.mol.clone() * T::from(6.02214076e+23_f64);
72 }
73
74 pub fn from_count(count: T) -> Self {
81 Amount{mol: count * T::from(1.66053906717385e-24_f64)}
82 }
83
84 pub fn to_mmol(&self) -> T {
88 return self.mol.clone() * T::from(1000.0_f64);
89 }
90
91 pub fn from_mmol(mmol: T) -> Self {
98 Amount{mol: mmol * T::from(0.001_f64)}
99 }
100
101 pub fn to_umol(&self) -> T {
105 return self.mol.clone() * T::from(1000000.0_f64);
106 }
107
108 pub fn from_umol(umol: T) -> Self {
115 Amount{mol: umol * T::from(1e-06_f64)}
116 }
117
118 pub fn to_nmol(&self) -> T {
122 return self.mol.clone() * T::from(1000000000.0_f64);
123 }
124
125 pub fn from_nmol(nmol: T) -> Self {
132 Amount{mol: nmol * T::from(1e-09_f64)}
133 }
134
135 pub fn to_pmol(&self) -> T {
139 return self.mol.clone() * T::from(1000000000000.0_f64);
140 }
141
142 pub fn from_pmol(pmol: T) -> Self {
149 Amount{mol: pmol * T::from(1e-12_f64)}
150 }
151
152}
153
154
155#[cfg(feature="num-bigfloat")]
157impl core::ops::Mul<Amount<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
158 type Output = Amount<num_bigfloat::BigFloat>;
159 fn mul(self, rhs: Amount<num_bigfloat::BigFloat>) -> Self::Output {
160 Amount{mol: self * rhs.mol}
161 }
162}
163#[cfg(feature="num-bigfloat")]
165impl core::ops::Mul<Amount<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
166 type Output = Amount<num_bigfloat::BigFloat>;
167 fn mul(self, rhs: Amount<num_bigfloat::BigFloat>) -> Self::Output {
168 Amount{mol: self.clone() * rhs.mol}
169 }
170}
171#[cfg(feature="num-bigfloat")]
173impl core::ops::Mul<&Amount<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
174 type Output = Amount<num_bigfloat::BigFloat>;
175 fn mul(self, rhs: &Amount<num_bigfloat::BigFloat>) -> Self::Output {
176 Amount{mol: self * rhs.mol.clone()}
177 }
178}
179#[cfg(feature="num-bigfloat")]
181impl core::ops::Mul<&Amount<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
182 type Output = Amount<num_bigfloat::BigFloat>;
183 fn mul(self, rhs: &Amount<num_bigfloat::BigFloat>) -> Self::Output {
184 Amount{mol: self.clone() * rhs.mol.clone()}
185 }
186}
187
188#[cfg(feature="num-complex")]
190impl core::ops::Mul<Amount<num_complex::Complex32>> for num_complex::Complex32 {
191 type Output = Amount<num_complex::Complex32>;
192 fn mul(self, rhs: Amount<num_complex::Complex32>) -> Self::Output {
193 Amount{mol: self * rhs.mol}
194 }
195}
196#[cfg(feature="num-complex")]
198impl core::ops::Mul<Amount<num_complex::Complex32>> for &num_complex::Complex32 {
199 type Output = Amount<num_complex::Complex32>;
200 fn mul(self, rhs: Amount<num_complex::Complex32>) -> Self::Output {
201 Amount{mol: self.clone() * rhs.mol}
202 }
203}
204#[cfg(feature="num-complex")]
206impl core::ops::Mul<&Amount<num_complex::Complex32>> for num_complex::Complex32 {
207 type Output = Amount<num_complex::Complex32>;
208 fn mul(self, rhs: &Amount<num_complex::Complex32>) -> Self::Output {
209 Amount{mol: self * rhs.mol.clone()}
210 }
211}
212#[cfg(feature="num-complex")]
214impl core::ops::Mul<&Amount<num_complex::Complex32>> for &num_complex::Complex32 {
215 type Output = Amount<num_complex::Complex32>;
216 fn mul(self, rhs: &Amount<num_complex::Complex32>) -> Self::Output {
217 Amount{mol: self.clone() * rhs.mol.clone()}
218 }
219}
220
221#[cfg(feature="num-complex")]
223impl core::ops::Mul<Amount<num_complex::Complex64>> for num_complex::Complex64 {
224 type Output = Amount<num_complex::Complex64>;
225 fn mul(self, rhs: Amount<num_complex::Complex64>) -> Self::Output {
226 Amount{mol: self * rhs.mol}
227 }
228}
229#[cfg(feature="num-complex")]
231impl core::ops::Mul<Amount<num_complex::Complex64>> for &num_complex::Complex64 {
232 type Output = Amount<num_complex::Complex64>;
233 fn mul(self, rhs: Amount<num_complex::Complex64>) -> Self::Output {
234 Amount{mol: self.clone() * rhs.mol}
235 }
236}
237#[cfg(feature="num-complex")]
239impl core::ops::Mul<&Amount<num_complex::Complex64>> for num_complex::Complex64 {
240 type Output = Amount<num_complex::Complex64>;
241 fn mul(self, rhs: &Amount<num_complex::Complex64>) -> Self::Output {
242 Amount{mol: self * rhs.mol.clone()}
243 }
244}
245#[cfg(feature="num-complex")]
247impl core::ops::Mul<&Amount<num_complex::Complex64>> for &num_complex::Complex64 {
248 type Output = Amount<num_complex::Complex64>;
249 fn mul(self, rhs: &Amount<num_complex::Complex64>) -> Self::Output {
250 Amount{mol: self.clone() * rhs.mol.clone()}
251 }
252}
253
254
255
256#[cfg(feature = "uom")]
258impl<T> Into<uom::si::f32::AmountOfSubstance> for Amount<T> where T: NumLike+Into<f32> {
259 fn into(self) -> uom::si::f32::AmountOfSubstance {
260 uom::si::f32::AmountOfSubstance::new::<uom::si::amount_of_substance::mole>(self.mol.into())
261 }
262}
263
264#[cfg(feature = "uom")]
266impl<T> From<uom::si::f32::AmountOfSubstance> for Amount<T> where T: NumLike+From<f32> {
267 fn from(src: uom::si::f32::AmountOfSubstance) -> Self {
268 Amount{mol: T::from(src.value)}
269 }
270}
271
272#[cfg(feature = "uom")]
274impl<T> Into<uom::si::f64::AmountOfSubstance> for Amount<T> where T: NumLike+Into<f64> {
275 fn into(self) -> uom::si::f64::AmountOfSubstance {
276 uom::si::f64::AmountOfSubstance::new::<uom::si::amount_of_substance::mole>(self.mol.into())
277 }
278}
279
280#[cfg(feature = "uom")]
282impl<T> From<uom::si::f64::AmountOfSubstance> for Amount<T> where T: NumLike+From<f64> {
283 fn from(src: uom::si::f64::AmountOfSubstance) -> Self {
284 Amount{mol: T::from(src.value)}
285 }
286}
287
288
289impl<T> core::ops::Mul<InverseMass<T>> for Amount<T> where T: NumLike {
292 type Output = Molality<T>;
293 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
294 Molality{molpkg: self.mol * rhs.per_kg}
295 }
296}
297impl<T> core::ops::Mul<InverseMass<T>> for &Amount<T> where T: NumLike {
299 type Output = Molality<T>;
300 fn mul(self, rhs: InverseMass<T>) -> Self::Output {
301 Molality{molpkg: self.mol.clone() * rhs.per_kg}
302 }
303}
304impl<T> core::ops::Mul<&InverseMass<T>> for Amount<T> where T: NumLike {
306 type Output = Molality<T>;
307 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
308 Molality{molpkg: self.mol * rhs.per_kg.clone()}
309 }
310}
311impl<T> core::ops::Mul<&InverseMass<T>> for &Amount<T> where T: NumLike {
313 type Output = Molality<T>;
314 fn mul(self, rhs: &InverseMass<T>) -> Self::Output {
315 Molality{molpkg: self.mol.clone() * rhs.per_kg.clone()}
316 }
317}
318
319impl<T> core::ops::Div<Mass<T>> for Amount<T> where T: NumLike {
322 type Output = Molality<T>;
323 fn div(self, rhs: Mass<T>) -> Self::Output {
324 Molality{molpkg: self.mol / rhs.kg}
325 }
326}
327impl<T> core::ops::Div<Mass<T>> for &Amount<T> where T: NumLike {
329 type Output = Molality<T>;
330 fn div(self, rhs: Mass<T>) -> Self::Output {
331 Molality{molpkg: self.mol.clone() / rhs.kg}
332 }
333}
334impl<T> core::ops::Div<&Mass<T>> for Amount<T> where T: NumLike {
336 type Output = Molality<T>;
337 fn div(self, rhs: &Mass<T>) -> Self::Output {
338 Molality{molpkg: self.mol / rhs.kg.clone()}
339 }
340}
341impl<T> core::ops::Div<&Mass<T>> for &Amount<T> where T: NumLike {
343 type Output = Molality<T>;
344 fn div(self, rhs: &Mass<T>) -> Self::Output {
345 Molality{molpkg: self.mol.clone() / rhs.kg.clone()}
346 }
347}
348
349impl<T> core::ops::Div<Time<T>> for Amount<T> where T: NumLike {
352 type Output = CatalyticActivity<T>;
353 fn div(self, rhs: Time<T>) -> Self::Output {
354 CatalyticActivity{molps: self.mol / rhs.s}
355 }
356}
357impl<T> core::ops::Div<Time<T>> for &Amount<T> where T: NumLike {
359 type Output = CatalyticActivity<T>;
360 fn div(self, rhs: Time<T>) -> Self::Output {
361 CatalyticActivity{molps: self.mol.clone() / rhs.s}
362 }
363}
364impl<T> core::ops::Div<&Time<T>> for Amount<T> where T: NumLike {
366 type Output = CatalyticActivity<T>;
367 fn div(self, rhs: &Time<T>) -> Self::Output {
368 CatalyticActivity{molps: self.mol / rhs.s.clone()}
369 }
370}
371impl<T> core::ops::Div<&Time<T>> for &Amount<T> where T: NumLike {
373 type Output = CatalyticActivity<T>;
374 fn div(self, rhs: &Time<T>) -> Self::Output {
375 CatalyticActivity{molps: self.mol.clone() / rhs.s.clone()}
376 }
377}
378
379impl<T> core::ops::Div<CatalyticActivity<T>> for Amount<T> where T: NumLike {
382 type Output = Time<T>;
383 fn div(self, rhs: CatalyticActivity<T>) -> Self::Output {
384 Time{s: self.mol / rhs.molps}
385 }
386}
387impl<T> core::ops::Div<CatalyticActivity<T>> for &Amount<T> where T: NumLike {
389 type Output = Time<T>;
390 fn div(self, rhs: CatalyticActivity<T>) -> Self::Output {
391 Time{s: self.mol.clone() / rhs.molps}
392 }
393}
394impl<T> core::ops::Div<&CatalyticActivity<T>> for Amount<T> where T: NumLike {
396 type Output = Time<T>;
397 fn div(self, rhs: &CatalyticActivity<T>) -> Self::Output {
398 Time{s: self.mol / rhs.molps.clone()}
399 }
400}
401impl<T> core::ops::Div<&CatalyticActivity<T>> for &Amount<T> where T: NumLike {
403 type Output = Time<T>;
404 fn div(self, rhs: &CatalyticActivity<T>) -> Self::Output {
405 Time{s: self.mol.clone() / rhs.molps.clone()}
406 }
407}
408
409impl<T> core::ops::Div<Concentration<T>> for Amount<T> where T: NumLike {
412 type Output = Volume<T>;
413 fn div(self, rhs: Concentration<T>) -> Self::Output {
414 Volume{m3: self.mol / rhs.molpm3}
415 }
416}
417impl<T> core::ops::Div<Concentration<T>> for &Amount<T> where T: NumLike {
419 type Output = Volume<T>;
420 fn div(self, rhs: Concentration<T>) -> Self::Output {
421 Volume{m3: self.mol.clone() / rhs.molpm3}
422 }
423}
424impl<T> core::ops::Div<&Concentration<T>> for Amount<T> where T: NumLike {
426 type Output = Volume<T>;
427 fn div(self, rhs: &Concentration<T>) -> Self::Output {
428 Volume{m3: self.mol / rhs.molpm3.clone()}
429 }
430}
431impl<T> core::ops::Div<&Concentration<T>> for &Amount<T> where T: NumLike {
433 type Output = Volume<T>;
434 fn div(self, rhs: &Concentration<T>) -> Self::Output {
435 Volume{m3: self.mol.clone() / rhs.molpm3.clone()}
436 }
437}
438
439impl<T> core::ops::Mul<InverseCatalyticActivity<T>> for Amount<T> where T: NumLike {
442 type Output = Time<T>;
443 fn mul(self, rhs: InverseCatalyticActivity<T>) -> Self::Output {
444 Time{s: self.mol * rhs.s_per_mol}
445 }
446}
447impl<T> core::ops::Mul<InverseCatalyticActivity<T>> for &Amount<T> where T: NumLike {
449 type Output = Time<T>;
450 fn mul(self, rhs: InverseCatalyticActivity<T>) -> Self::Output {
451 Time{s: self.mol.clone() * rhs.s_per_mol}
452 }
453}
454impl<T> core::ops::Mul<&InverseCatalyticActivity<T>> for Amount<T> where T: NumLike {
456 type Output = Time<T>;
457 fn mul(self, rhs: &InverseCatalyticActivity<T>) -> Self::Output {
458 Time{s: self.mol * rhs.s_per_mol.clone()}
459 }
460}
461impl<T> core::ops::Mul<&InverseCatalyticActivity<T>> for &Amount<T> where T: NumLike {
463 type Output = Time<T>;
464 fn mul(self, rhs: &InverseCatalyticActivity<T>) -> Self::Output {
465 Time{s: self.mol.clone() * rhs.s_per_mol.clone()}
466 }
467}
468
469impl<T> core::ops::Div<Molality<T>> for Amount<T> where T: NumLike {
472 type Output = Mass<T>;
473 fn div(self, rhs: Molality<T>) -> Self::Output {
474 Mass{kg: self.mol / rhs.molpkg}
475 }
476}
477impl<T> core::ops::Div<Molality<T>> for &Amount<T> where T: NumLike {
479 type Output = Mass<T>;
480 fn div(self, rhs: Molality<T>) -> Self::Output {
481 Mass{kg: self.mol.clone() / rhs.molpkg}
482 }
483}
484impl<T> core::ops::Div<&Molality<T>> for Amount<T> where T: NumLike {
486 type Output = Mass<T>;
487 fn div(self, rhs: &Molality<T>) -> Self::Output {
488 Mass{kg: self.mol / rhs.molpkg.clone()}
489 }
490}
491impl<T> core::ops::Div<&Molality<T>> for &Amount<T> where T: NumLike {
493 type Output = Mass<T>;
494 fn div(self, rhs: &Molality<T>) -> Self::Output {
495 Mass{kg: self.mol.clone() / rhs.molpkg.clone()}
496 }
497}
498
499impl<T> core::ops::Mul<MolarMass<T>> for Amount<T> where T: NumLike {
502 type Output = Mass<T>;
503 fn mul(self, rhs: MolarMass<T>) -> Self::Output {
504 Mass{kg: self.mol * rhs.kgpmol}
505 }
506}
507impl<T> core::ops::Mul<MolarMass<T>> for &Amount<T> where T: NumLike {
509 type Output = Mass<T>;
510 fn mul(self, rhs: MolarMass<T>) -> Self::Output {
511 Mass{kg: self.mol.clone() * rhs.kgpmol}
512 }
513}
514impl<T> core::ops::Mul<&MolarMass<T>> for Amount<T> where T: NumLike {
516 type Output = Mass<T>;
517 fn mul(self, rhs: &MolarMass<T>) -> Self::Output {
518 Mass{kg: self.mol * rhs.kgpmol.clone()}
519 }
520}
521impl<T> core::ops::Mul<&MolarMass<T>> for &Amount<T> where T: NumLike {
523 type Output = Mass<T>;
524 fn mul(self, rhs: &MolarMass<T>) -> Self::Output {
525 Mass{kg: self.mol.clone() * rhs.kgpmol.clone()}
526 }
527}
528
529impl<T> core::ops::Mul<MolarVolume<T>> for Amount<T> where T: NumLike {
532 type Output = Volume<T>;
533 fn mul(self, rhs: MolarVolume<T>) -> Self::Output {
534 Volume{m3: self.mol * rhs.m3_per_mol}
535 }
536}
537impl<T> core::ops::Mul<MolarVolume<T>> for &Amount<T> where T: NumLike {
539 type Output = Volume<T>;
540 fn mul(self, rhs: MolarVolume<T>) -> Self::Output {
541 Volume{m3: self.mol.clone() * rhs.m3_per_mol}
542 }
543}
544impl<T> core::ops::Mul<&MolarVolume<T>> for Amount<T> where T: NumLike {
546 type Output = Volume<T>;
547 fn mul(self, rhs: &MolarVolume<T>) -> Self::Output {
548 Volume{m3: self.mol * rhs.m3_per_mol.clone()}
549 }
550}
551impl<T> core::ops::Mul<&MolarVolume<T>> for &Amount<T> where T: NumLike {
553 type Output = Volume<T>;
554 fn mul(self, rhs: &MolarVolume<T>) -> Self::Output {
555 Volume{m3: self.mol.clone() * rhs.m3_per_mol.clone()}
556 }
557}
558
559impl<T> core::ops::Mul<InverseVolume<T>> for Amount<T> where T: NumLike {
562 type Output = Concentration<T>;
563 fn mul(self, rhs: InverseVolume<T>) -> Self::Output {
564 Concentration{molpm3: self.mol * rhs.per_m3}
565 }
566}
567impl<T> core::ops::Mul<InverseVolume<T>> for &Amount<T> where T: NumLike {
569 type Output = Concentration<T>;
570 fn mul(self, rhs: InverseVolume<T>) -> Self::Output {
571 Concentration{molpm3: self.mol.clone() * rhs.per_m3}
572 }
573}
574impl<T> core::ops::Mul<&InverseVolume<T>> for Amount<T> where T: NumLike {
576 type Output = Concentration<T>;
577 fn mul(self, rhs: &InverseVolume<T>) -> Self::Output {
578 Concentration{molpm3: self.mol * rhs.per_m3.clone()}
579 }
580}
581impl<T> core::ops::Mul<&InverseVolume<T>> for &Amount<T> where T: NumLike {
583 type Output = Concentration<T>;
584 fn mul(self, rhs: &InverseVolume<T>) -> Self::Output {
585 Concentration{molpm3: self.mol.clone() * rhs.per_m3.clone()}
586 }
587}
588
589impl<T> core::ops::Div<Volume<T>> for Amount<T> where T: NumLike {
592 type Output = Concentration<T>;
593 fn div(self, rhs: Volume<T>) -> Self::Output {
594 Concentration{molpm3: self.mol / rhs.m3}
595 }
596}
597impl<T> core::ops::Div<Volume<T>> for &Amount<T> where T: NumLike {
599 type Output = Concentration<T>;
600 fn div(self, rhs: Volume<T>) -> Self::Output {
601 Concentration{molpm3: self.mol.clone() / rhs.m3}
602 }
603}
604impl<T> core::ops::Div<&Volume<T>> for Amount<T> where T: NumLike {
606 type Output = Concentration<T>;
607 fn div(self, rhs: &Volume<T>) -> Self::Output {
608 Concentration{molpm3: self.mol / rhs.m3.clone()}
609 }
610}
611impl<T> core::ops::Div<&Volume<T>> for &Amount<T> where T: NumLike {
613 type Output = Concentration<T>;
614 fn div(self, rhs: &Volume<T>) -> Self::Output {
615 Concentration{molpm3: self.mol.clone() / rhs.m3.clone()}
616 }
617}
618
619impl<T> core::ops::Mul<Frequency<T>> for Amount<T> where T: NumLike {
622 type Output = CatalyticActivity<T>;
623 fn mul(self, rhs: Frequency<T>) -> Self::Output {
624 CatalyticActivity{molps: self.mol * rhs.Hz}
625 }
626}
627impl<T> core::ops::Mul<Frequency<T>> for &Amount<T> where T: NumLike {
629 type Output = CatalyticActivity<T>;
630 fn mul(self, rhs: Frequency<T>) -> Self::Output {
631 CatalyticActivity{molps: self.mol.clone() * rhs.Hz}
632 }
633}
634impl<T> core::ops::Mul<&Frequency<T>> for Amount<T> where T: NumLike {
636 type Output = CatalyticActivity<T>;
637 fn mul(self, rhs: &Frequency<T>) -> Self::Output {
638 CatalyticActivity{molps: self.mol * rhs.Hz.clone()}
639 }
640}
641impl<T> core::ops::Mul<&Frequency<T>> for &Amount<T> where T: NumLike {
643 type Output = CatalyticActivity<T>;
644 fn mul(self, rhs: &Frequency<T>) -> Self::Output {
645 CatalyticActivity{molps: self.mol.clone() * rhs.Hz.clone()}
646 }
647}
648
649impl<T> core::ops::Div<Amount<T>> for f64 where T: NumLike+From<f64> {
652 type Output = InverseAmount<T>;
653 fn div(self, rhs: Amount<T>) -> Self::Output {
654 InverseAmount{per_mol: T::from(self) / rhs.mol}
655 }
656}
657impl<T> core::ops::Div<Amount<T>> for &f64 where T: NumLike+From<f64> {
659 type Output = InverseAmount<T>;
660 fn div(self, rhs: Amount<T>) -> Self::Output {
661 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol}
662 }
663}
664impl<T> core::ops::Div<&Amount<T>> for f64 where T: NumLike+From<f64> {
666 type Output = InverseAmount<T>;
667 fn div(self, rhs: &Amount<T>) -> Self::Output {
668 InverseAmount{per_mol: T::from(self) / rhs.mol.clone()}
669 }
670}
671impl<T> core::ops::Div<&Amount<T>> for &f64 where T: NumLike+From<f64> {
673 type Output = InverseAmount<T>;
674 fn div(self, rhs: &Amount<T>) -> Self::Output {
675 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol.clone()}
676 }
677}
678
679impl<T> core::ops::Div<Amount<T>> for f32 where T: NumLike+From<f32> {
682 type Output = InverseAmount<T>;
683 fn div(self, rhs: Amount<T>) -> Self::Output {
684 InverseAmount{per_mol: T::from(self) / rhs.mol}
685 }
686}
687impl<T> core::ops::Div<Amount<T>> for &f32 where T: NumLike+From<f32> {
689 type Output = InverseAmount<T>;
690 fn div(self, rhs: Amount<T>) -> Self::Output {
691 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol}
692 }
693}
694impl<T> core::ops::Div<&Amount<T>> for f32 where T: NumLike+From<f32> {
696 type Output = InverseAmount<T>;
697 fn div(self, rhs: &Amount<T>) -> Self::Output {
698 InverseAmount{per_mol: T::from(self) / rhs.mol.clone()}
699 }
700}
701impl<T> core::ops::Div<&Amount<T>> for &f32 where T: NumLike+From<f32> {
703 type Output = InverseAmount<T>;
704 fn div(self, rhs: &Amount<T>) -> Self::Output {
705 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol.clone()}
706 }
707}
708
709impl<T> core::ops::Div<Amount<T>> for i64 where T: NumLike+From<i64> {
712 type Output = InverseAmount<T>;
713 fn div(self, rhs: Amount<T>) -> Self::Output {
714 InverseAmount{per_mol: T::from(self) / rhs.mol}
715 }
716}
717impl<T> core::ops::Div<Amount<T>> for &i64 where T: NumLike+From<i64> {
719 type Output = InverseAmount<T>;
720 fn div(self, rhs: Amount<T>) -> Self::Output {
721 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol}
722 }
723}
724impl<T> core::ops::Div<&Amount<T>> for i64 where T: NumLike+From<i64> {
726 type Output = InverseAmount<T>;
727 fn div(self, rhs: &Amount<T>) -> Self::Output {
728 InverseAmount{per_mol: T::from(self) / rhs.mol.clone()}
729 }
730}
731impl<T> core::ops::Div<&Amount<T>> for &i64 where T: NumLike+From<i64> {
733 type Output = InverseAmount<T>;
734 fn div(self, rhs: &Amount<T>) -> Self::Output {
735 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol.clone()}
736 }
737}
738
739impl<T> core::ops::Div<Amount<T>> for i32 where T: NumLike+From<i32> {
742 type Output = InverseAmount<T>;
743 fn div(self, rhs: Amount<T>) -> Self::Output {
744 InverseAmount{per_mol: T::from(self) / rhs.mol}
745 }
746}
747impl<T> core::ops::Div<Amount<T>> for &i32 where T: NumLike+From<i32> {
749 type Output = InverseAmount<T>;
750 fn div(self, rhs: Amount<T>) -> Self::Output {
751 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol}
752 }
753}
754impl<T> core::ops::Div<&Amount<T>> for i32 where T: NumLike+From<i32> {
756 type Output = InverseAmount<T>;
757 fn div(self, rhs: &Amount<T>) -> Self::Output {
758 InverseAmount{per_mol: T::from(self) / rhs.mol.clone()}
759 }
760}
761impl<T> core::ops::Div<&Amount<T>> for &i32 where T: NumLike+From<i32> {
763 type Output = InverseAmount<T>;
764 fn div(self, rhs: &Amount<T>) -> Self::Output {
765 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol.clone()}
766 }
767}
768
769#[cfg(feature="num-bigfloat")]
772impl<T> core::ops::Div<Amount<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
773 type Output = InverseAmount<T>;
774 fn div(self, rhs: Amount<T>) -> Self::Output {
775 InverseAmount{per_mol: T::from(self) / rhs.mol}
776 }
777}
778#[cfg(feature="num-bigfloat")]
780impl<T> core::ops::Div<Amount<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
781 type Output = InverseAmount<T>;
782 fn div(self, rhs: Amount<T>) -> Self::Output {
783 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol}
784 }
785}
786#[cfg(feature="num-bigfloat")]
788impl<T> core::ops::Div<&Amount<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
789 type Output = InverseAmount<T>;
790 fn div(self, rhs: &Amount<T>) -> Self::Output {
791 InverseAmount{per_mol: T::from(self) / rhs.mol.clone()}
792 }
793}
794#[cfg(feature="num-bigfloat")]
796impl<T> core::ops::Div<&Amount<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
797 type Output = InverseAmount<T>;
798 fn div(self, rhs: &Amount<T>) -> Self::Output {
799 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol.clone()}
800 }
801}
802
803#[cfg(feature="num-complex")]
806impl<T> core::ops::Div<Amount<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
807 type Output = InverseAmount<T>;
808 fn div(self, rhs: Amount<T>) -> Self::Output {
809 InverseAmount{per_mol: T::from(self) / rhs.mol}
810 }
811}
812#[cfg(feature="num-complex")]
814impl<T> core::ops::Div<Amount<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
815 type Output = InverseAmount<T>;
816 fn div(self, rhs: Amount<T>) -> Self::Output {
817 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol}
818 }
819}
820#[cfg(feature="num-complex")]
822impl<T> core::ops::Div<&Amount<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
823 type Output = InverseAmount<T>;
824 fn div(self, rhs: &Amount<T>) -> Self::Output {
825 InverseAmount{per_mol: T::from(self) / rhs.mol.clone()}
826 }
827}
828#[cfg(feature="num-complex")]
830impl<T> core::ops::Div<&Amount<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
831 type Output = InverseAmount<T>;
832 fn div(self, rhs: &Amount<T>) -> Self::Output {
833 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol.clone()}
834 }
835}
836
837#[cfg(feature="num-complex")]
840impl<T> core::ops::Div<Amount<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
841 type Output = InverseAmount<T>;
842 fn div(self, rhs: Amount<T>) -> Self::Output {
843 InverseAmount{per_mol: T::from(self) / rhs.mol}
844 }
845}
846#[cfg(feature="num-complex")]
848impl<T> core::ops::Div<Amount<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
849 type Output = InverseAmount<T>;
850 fn div(self, rhs: Amount<T>) -> Self::Output {
851 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol}
852 }
853}
854#[cfg(feature="num-complex")]
856impl<T> core::ops::Div<&Amount<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
857 type Output = InverseAmount<T>;
858 fn div(self, rhs: &Amount<T>) -> Self::Output {
859 InverseAmount{per_mol: T::from(self) / rhs.mol.clone()}
860 }
861}
862#[cfg(feature="num-complex")]
864impl<T> core::ops::Div<&Amount<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
865 type Output = InverseAmount<T>;
866 fn div(self, rhs: &Amount<T>) -> Self::Output {
867 InverseAmount{per_mol: T::from(self.clone()) / rhs.mol.clone()}
868 }
869}
870
871#[derive(UnitStruct, Debug, Clone)]
873#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
874pub struct Current<T: NumLike>{
875 pub A: T
877}
878
879impl<T> Current<T> where T: NumLike {
880
881 pub fn unit_name() -> &'static str { "amperes" }
883
884 pub fn unit_symbol() -> &'static str { "A" }
886
887 pub fn from_A(A: T) -> Self { Current{A: A} }
892
893 pub fn to_A(&self) -> T { self.A.clone() }
895
896 pub fn from_amps(amps: T) -> Self { Current{A: amps} }
901
902 pub fn to_amps(&self) -> T { self.A.clone() }
904
905}
906
907impl<T> fmt::Display for Current<T> where T: NumLike {
908 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
909 write!(f, "{} {}", &self.A, Self::unit_symbol())
910 }
911}
912
913impl<T> Current<T> where T: NumLike+From<f64> {
914
915 pub fn to_mA(&self) -> T {
919 return self.A.clone() * T::from(1000.0_f64);
920 }
921
922 pub fn from_mA(mA: T) -> Self {
929 Current{A: mA * T::from(0.001_f64)}
930 }
931
932 pub fn to_uA(&self) -> T {
936 return self.A.clone() * T::from(1000000.0_f64);
937 }
938
939 pub fn from_uA(uA: T) -> Self {
946 Current{A: uA * T::from(1e-06_f64)}
947 }
948
949 pub fn to_nA(&self) -> T {
953 return self.A.clone() * T::from(1000000000.0_f64);
954 }
955
956 pub fn from_nA(nA: T) -> Self {
963 Current{A: nA * T::from(1e-09_f64)}
964 }
965
966 pub fn to_kA(&self) -> T {
970 return self.A.clone() * T::from(0.001_f64);
971 }
972
973 pub fn from_kA(kA: T) -> Self {
980 Current{A: kA * T::from(1000.0_f64)}
981 }
982
983 pub fn to_MA(&self) -> T {
987 return self.A.clone() * T::from(1e-06_f64);
988 }
989
990 pub fn from_MA(MA: T) -> Self {
997 Current{A: MA * T::from(1000000.0_f64)}
998 }
999
1000 pub fn to_GA(&self) -> T {
1004 return self.A.clone() * T::from(1e-09_f64);
1005 }
1006
1007 pub fn from_GA(GA: T) -> Self {
1014 Current{A: GA * T::from(1000000000.0_f64)}
1015 }
1016
1017}
1018
1019
1020#[cfg(feature="num-bigfloat")]
1022impl core::ops::Mul<Current<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
1023 type Output = Current<num_bigfloat::BigFloat>;
1024 fn mul(self, rhs: Current<num_bigfloat::BigFloat>) -> Self::Output {
1025 Current{A: self * rhs.A}
1026 }
1027}
1028#[cfg(feature="num-bigfloat")]
1030impl core::ops::Mul<Current<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
1031 type Output = Current<num_bigfloat::BigFloat>;
1032 fn mul(self, rhs: Current<num_bigfloat::BigFloat>) -> Self::Output {
1033 Current{A: self.clone() * rhs.A}
1034 }
1035}
1036#[cfg(feature="num-bigfloat")]
1038impl core::ops::Mul<&Current<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
1039 type Output = Current<num_bigfloat::BigFloat>;
1040 fn mul(self, rhs: &Current<num_bigfloat::BigFloat>) -> Self::Output {
1041 Current{A: self * rhs.A.clone()}
1042 }
1043}
1044#[cfg(feature="num-bigfloat")]
1046impl core::ops::Mul<&Current<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
1047 type Output = Current<num_bigfloat::BigFloat>;
1048 fn mul(self, rhs: &Current<num_bigfloat::BigFloat>) -> Self::Output {
1049 Current{A: self.clone() * rhs.A.clone()}
1050 }
1051}
1052
1053#[cfg(feature="num-complex")]
1055impl core::ops::Mul<Current<num_complex::Complex32>> for num_complex::Complex32 {
1056 type Output = Current<num_complex::Complex32>;
1057 fn mul(self, rhs: Current<num_complex::Complex32>) -> Self::Output {
1058 Current{A: self * rhs.A}
1059 }
1060}
1061#[cfg(feature="num-complex")]
1063impl core::ops::Mul<Current<num_complex::Complex32>> for &num_complex::Complex32 {
1064 type Output = Current<num_complex::Complex32>;
1065 fn mul(self, rhs: Current<num_complex::Complex32>) -> Self::Output {
1066 Current{A: self.clone() * rhs.A}
1067 }
1068}
1069#[cfg(feature="num-complex")]
1071impl core::ops::Mul<&Current<num_complex::Complex32>> for num_complex::Complex32 {
1072 type Output = Current<num_complex::Complex32>;
1073 fn mul(self, rhs: &Current<num_complex::Complex32>) -> Self::Output {
1074 Current{A: self * rhs.A.clone()}
1075 }
1076}
1077#[cfg(feature="num-complex")]
1079impl core::ops::Mul<&Current<num_complex::Complex32>> for &num_complex::Complex32 {
1080 type Output = Current<num_complex::Complex32>;
1081 fn mul(self, rhs: &Current<num_complex::Complex32>) -> Self::Output {
1082 Current{A: self.clone() * rhs.A.clone()}
1083 }
1084}
1085
1086#[cfg(feature="num-complex")]
1088impl core::ops::Mul<Current<num_complex::Complex64>> for num_complex::Complex64 {
1089 type Output = Current<num_complex::Complex64>;
1090 fn mul(self, rhs: Current<num_complex::Complex64>) -> Self::Output {
1091 Current{A: self * rhs.A}
1092 }
1093}
1094#[cfg(feature="num-complex")]
1096impl core::ops::Mul<Current<num_complex::Complex64>> for &num_complex::Complex64 {
1097 type Output = Current<num_complex::Complex64>;
1098 fn mul(self, rhs: Current<num_complex::Complex64>) -> Self::Output {
1099 Current{A: self.clone() * rhs.A}
1100 }
1101}
1102#[cfg(feature="num-complex")]
1104impl core::ops::Mul<&Current<num_complex::Complex64>> for num_complex::Complex64 {
1105 type Output = Current<num_complex::Complex64>;
1106 fn mul(self, rhs: &Current<num_complex::Complex64>) -> Self::Output {
1107 Current{A: self * rhs.A.clone()}
1108 }
1109}
1110#[cfg(feature="num-complex")]
1112impl core::ops::Mul<&Current<num_complex::Complex64>> for &num_complex::Complex64 {
1113 type Output = Current<num_complex::Complex64>;
1114 fn mul(self, rhs: &Current<num_complex::Complex64>) -> Self::Output {
1115 Current{A: self.clone() * rhs.A.clone()}
1116 }
1117}
1118
1119
1120
1121#[cfg(feature = "uom")]
1123impl<T> Into<uom::si::f32::ElectricCurrent> for Current<T> where T: NumLike+Into<f32> {
1124 fn into(self) -> uom::si::f32::ElectricCurrent {
1125 uom::si::f32::ElectricCurrent::new::<uom::si::electric_current::ampere>(self.A.into())
1126 }
1127}
1128
1129#[cfg(feature = "uom")]
1131impl<T> From<uom::si::f32::ElectricCurrent> for Current<T> where T: NumLike+From<f32> {
1132 fn from(src: uom::si::f32::ElectricCurrent) -> Self {
1133 Current{A: T::from(src.value)}
1134 }
1135}
1136
1137#[cfg(feature = "uom")]
1139impl<T> Into<uom::si::f64::ElectricCurrent> for Current<T> where T: NumLike+Into<f64> {
1140 fn into(self) -> uom::si::f64::ElectricCurrent {
1141 uom::si::f64::ElectricCurrent::new::<uom::si::electric_current::ampere>(self.A.into())
1142 }
1143}
1144
1145#[cfg(feature = "uom")]
1147impl<T> From<uom::si::f64::ElectricCurrent> for Current<T> where T: NumLike+From<f64> {
1148 fn from(src: uom::si::f64::ElectricCurrent) -> Self {
1149 Current{A: T::from(src.value)}
1150 }
1151}
1152
1153
1154impl<T> core::ops::Mul<Time<T>> for Current<T> where T: NumLike {
1157 type Output = Charge<T>;
1158 fn mul(self, rhs: Time<T>) -> Self::Output {
1159 Charge{C: self.A * rhs.s}
1160 }
1161}
1162impl<T> core::ops::Mul<Time<T>> for &Current<T> where T: NumLike {
1164 type Output = Charge<T>;
1165 fn mul(self, rhs: Time<T>) -> Self::Output {
1166 Charge{C: self.A.clone() * rhs.s}
1167 }
1168}
1169impl<T> core::ops::Mul<&Time<T>> for Current<T> where T: NumLike {
1171 type Output = Charge<T>;
1172 fn mul(self, rhs: &Time<T>) -> Self::Output {
1173 Charge{C: self.A * rhs.s.clone()}
1174 }
1175}
1176impl<T> core::ops::Mul<&Time<T>> for &Current<T> where T: NumLike {
1178 type Output = Charge<T>;
1179 fn mul(self, rhs: &Time<T>) -> Self::Output {
1180 Charge{C: self.A.clone() * rhs.s.clone()}
1181 }
1182}
1183
1184impl<T> core::ops::Div<Charge<T>> for Current<T> where T: NumLike {
1187 type Output = Frequency<T>;
1188 fn div(self, rhs: Charge<T>) -> Self::Output {
1189 Frequency{Hz: self.A / rhs.C}
1190 }
1191}
1192impl<T> core::ops::Div<Charge<T>> for &Current<T> where T: NumLike {
1194 type Output = Frequency<T>;
1195 fn div(self, rhs: Charge<T>) -> Self::Output {
1196 Frequency{Hz: self.A.clone() / rhs.C}
1197 }
1198}
1199impl<T> core::ops::Div<&Charge<T>> for Current<T> where T: NumLike {
1201 type Output = Frequency<T>;
1202 fn div(self, rhs: &Charge<T>) -> Self::Output {
1203 Frequency{Hz: self.A / rhs.C.clone()}
1204 }
1205}
1206impl<T> core::ops::Div<&Charge<T>> for &Current<T> where T: NumLike {
1208 type Output = Frequency<T>;
1209 fn div(self, rhs: &Charge<T>) -> Self::Output {
1210 Frequency{Hz: self.A.clone() / rhs.C.clone()}
1211 }
1212}
1213
1214impl<T> core::ops::Div<Conductance<T>> for Current<T> where T: NumLike {
1217 type Output = Voltage<T>;
1218 fn div(self, rhs: Conductance<T>) -> Self::Output {
1219 Voltage{V: self.A / rhs.S}
1220 }
1221}
1222impl<T> core::ops::Div<Conductance<T>> for &Current<T> where T: NumLike {
1224 type Output = Voltage<T>;
1225 fn div(self, rhs: Conductance<T>) -> Self::Output {
1226 Voltage{V: self.A.clone() / rhs.S}
1227 }
1228}
1229impl<T> core::ops::Div<&Conductance<T>> for Current<T> where T: NumLike {
1231 type Output = Voltage<T>;
1232 fn div(self, rhs: &Conductance<T>) -> Self::Output {
1233 Voltage{V: self.A / rhs.S.clone()}
1234 }
1235}
1236impl<T> core::ops::Div<&Conductance<T>> for &Current<T> where T: NumLike {
1238 type Output = Voltage<T>;
1239 fn div(self, rhs: &Conductance<T>) -> Self::Output {
1240 Voltage{V: self.A.clone() / rhs.S.clone()}
1241 }
1242}
1243
1244impl<T> core::ops::Mul<Inductance<T>> for Current<T> where T: NumLike {
1247 type Output = MagneticFlux<T>;
1248 fn mul(self, rhs: Inductance<T>) -> Self::Output {
1249 MagneticFlux{Wb: self.A * rhs.H}
1250 }
1251}
1252impl<T> core::ops::Mul<Inductance<T>> for &Current<T> where T: NumLike {
1254 type Output = MagneticFlux<T>;
1255 fn mul(self, rhs: Inductance<T>) -> Self::Output {
1256 MagneticFlux{Wb: self.A.clone() * rhs.H}
1257 }
1258}
1259impl<T> core::ops::Mul<&Inductance<T>> for Current<T> where T: NumLike {
1261 type Output = MagneticFlux<T>;
1262 fn mul(self, rhs: &Inductance<T>) -> Self::Output {
1263 MagneticFlux{Wb: self.A * rhs.H.clone()}
1264 }
1265}
1266impl<T> core::ops::Mul<&Inductance<T>> for &Current<T> where T: NumLike {
1268 type Output = MagneticFlux<T>;
1269 fn mul(self, rhs: &Inductance<T>) -> Self::Output {
1270 MagneticFlux{Wb: self.A.clone() * rhs.H.clone()}
1271 }
1272}
1273
1274impl<T> core::ops::Mul<InverseCharge<T>> for Current<T> where T: NumLike {
1277 type Output = Frequency<T>;
1278 fn mul(self, rhs: InverseCharge<T>) -> Self::Output {
1279 Frequency{Hz: self.A * rhs.per_C}
1280 }
1281}
1282impl<T> core::ops::Mul<InverseCharge<T>> for &Current<T> where T: NumLike {
1284 type Output = Frequency<T>;
1285 fn mul(self, rhs: InverseCharge<T>) -> Self::Output {
1286 Frequency{Hz: self.A.clone() * rhs.per_C}
1287 }
1288}
1289impl<T> core::ops::Mul<&InverseCharge<T>> for Current<T> where T: NumLike {
1291 type Output = Frequency<T>;
1292 fn mul(self, rhs: &InverseCharge<T>) -> Self::Output {
1293 Frequency{Hz: self.A * rhs.per_C.clone()}
1294 }
1295}
1296impl<T> core::ops::Mul<&InverseCharge<T>> for &Current<T> where T: NumLike {
1298 type Output = Frequency<T>;
1299 fn mul(self, rhs: &InverseCharge<T>) -> Self::Output {
1300 Frequency{Hz: self.A.clone() * rhs.per_C.clone()}
1301 }
1302}
1303
1304impl<T> core::ops::Div<InverseInductance<T>> for Current<T> where T: NumLike {
1307 type Output = MagneticFlux<T>;
1308 fn div(self, rhs: InverseInductance<T>) -> Self::Output {
1309 MagneticFlux{Wb: self.A / rhs.per_H}
1310 }
1311}
1312impl<T> core::ops::Div<InverseInductance<T>> for &Current<T> where T: NumLike {
1314 type Output = MagneticFlux<T>;
1315 fn div(self, rhs: InverseInductance<T>) -> Self::Output {
1316 MagneticFlux{Wb: self.A.clone() / rhs.per_H}
1317 }
1318}
1319impl<T> core::ops::Div<&InverseInductance<T>> for Current<T> where T: NumLike {
1321 type Output = MagneticFlux<T>;
1322 fn div(self, rhs: &InverseInductance<T>) -> Self::Output {
1323 MagneticFlux{Wb: self.A / rhs.per_H.clone()}
1324 }
1325}
1326impl<T> core::ops::Div<&InverseInductance<T>> for &Current<T> where T: NumLike {
1328 type Output = MagneticFlux<T>;
1329 fn div(self, rhs: &InverseInductance<T>) -> Self::Output {
1330 MagneticFlux{Wb: self.A.clone() / rhs.per_H.clone()}
1331 }
1332}
1333
1334impl<T> core::ops::Mul<InverseMagneticFlux<T>> for Current<T> where T: NumLike {
1337 type Output = InverseInductance<T>;
1338 fn mul(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
1339 InverseInductance{per_H: self.A * rhs.per_Wb}
1340 }
1341}
1342impl<T> core::ops::Mul<InverseMagneticFlux<T>> for &Current<T> where T: NumLike {
1344 type Output = InverseInductance<T>;
1345 fn mul(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
1346 InverseInductance{per_H: self.A.clone() * rhs.per_Wb}
1347 }
1348}
1349impl<T> core::ops::Mul<&InverseMagneticFlux<T>> for Current<T> where T: NumLike {
1351 type Output = InverseInductance<T>;
1352 fn mul(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
1353 InverseInductance{per_H: self.A * rhs.per_Wb.clone()}
1354 }
1355}
1356impl<T> core::ops::Mul<&InverseMagneticFlux<T>> for &Current<T> where T: NumLike {
1358 type Output = InverseInductance<T>;
1359 fn mul(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
1360 InverseInductance{per_H: self.A.clone() * rhs.per_Wb.clone()}
1361 }
1362}
1363
1364impl<T> core::ops::Div<InverseMagneticFlux<T>> for Current<T> where T: NumLike {
1367 type Output = Energy<T>;
1368 fn div(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
1369 Energy{J: self.A / rhs.per_Wb}
1370 }
1371}
1372impl<T> core::ops::Div<InverseMagneticFlux<T>> for &Current<T> where T: NumLike {
1374 type Output = Energy<T>;
1375 fn div(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
1376 Energy{J: self.A.clone() / rhs.per_Wb}
1377 }
1378}
1379impl<T> core::ops::Div<&InverseMagneticFlux<T>> for Current<T> where T: NumLike {
1381 type Output = Energy<T>;
1382 fn div(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
1383 Energy{J: self.A / rhs.per_Wb.clone()}
1384 }
1385}
1386impl<T> core::ops::Div<&InverseMagneticFlux<T>> for &Current<T> where T: NumLike {
1388 type Output = Energy<T>;
1389 fn div(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
1390 Energy{J: self.A.clone() / rhs.per_Wb.clone()}
1391 }
1392}
1393
1394impl<T> core::ops::Mul<InverseVoltage<T>> for Current<T> where T: NumLike {
1397 type Output = Conductance<T>;
1398 fn mul(self, rhs: InverseVoltage<T>) -> Self::Output {
1399 Conductance{S: self.A * rhs.per_V}
1400 }
1401}
1402impl<T> core::ops::Mul<InverseVoltage<T>> for &Current<T> where T: NumLike {
1404 type Output = Conductance<T>;
1405 fn mul(self, rhs: InverseVoltage<T>) -> Self::Output {
1406 Conductance{S: self.A.clone() * rhs.per_V}
1407 }
1408}
1409impl<T> core::ops::Mul<&InverseVoltage<T>> for Current<T> where T: NumLike {
1411 type Output = Conductance<T>;
1412 fn mul(self, rhs: &InverseVoltage<T>) -> Self::Output {
1413 Conductance{S: self.A * rhs.per_V.clone()}
1414 }
1415}
1416impl<T> core::ops::Mul<&InverseVoltage<T>> for &Current<T> where T: NumLike {
1418 type Output = Conductance<T>;
1419 fn mul(self, rhs: &InverseVoltage<T>) -> Self::Output {
1420 Conductance{S: self.A.clone() * rhs.per_V.clone()}
1421 }
1422}
1423
1424impl<T> core::ops::Div<InverseVoltage<T>> for Current<T> where T: NumLike {
1427 type Output = Power<T>;
1428 fn div(self, rhs: InverseVoltage<T>) -> Self::Output {
1429 Power{W: self.A / rhs.per_V}
1430 }
1431}
1432impl<T> core::ops::Div<InverseVoltage<T>> for &Current<T> where T: NumLike {
1434 type Output = Power<T>;
1435 fn div(self, rhs: InverseVoltage<T>) -> Self::Output {
1436 Power{W: self.A.clone() / rhs.per_V}
1437 }
1438}
1439impl<T> core::ops::Div<&InverseVoltage<T>> for Current<T> where T: NumLike {
1441 type Output = Power<T>;
1442 fn div(self, rhs: &InverseVoltage<T>) -> Self::Output {
1443 Power{W: self.A / rhs.per_V.clone()}
1444 }
1445}
1446impl<T> core::ops::Div<&InverseVoltage<T>> for &Current<T> where T: NumLike {
1448 type Output = Power<T>;
1449 fn div(self, rhs: &InverseVoltage<T>) -> Self::Output {
1450 Power{W: self.A.clone() / rhs.per_V.clone()}
1451 }
1452}
1453
1454impl<T> core::ops::Mul<MagneticFlux<T>> for Current<T> where T: NumLike {
1457 type Output = Energy<T>;
1458 fn mul(self, rhs: MagneticFlux<T>) -> Self::Output {
1459 Energy{J: self.A * rhs.Wb}
1460 }
1461}
1462impl<T> core::ops::Mul<MagneticFlux<T>> for &Current<T> where T: NumLike {
1464 type Output = Energy<T>;
1465 fn mul(self, rhs: MagneticFlux<T>) -> Self::Output {
1466 Energy{J: self.A.clone() * rhs.Wb}
1467 }
1468}
1469impl<T> core::ops::Mul<&MagneticFlux<T>> for Current<T> where T: NumLike {
1471 type Output = Energy<T>;
1472 fn mul(self, rhs: &MagneticFlux<T>) -> Self::Output {
1473 Energy{J: self.A * rhs.Wb.clone()}
1474 }
1475}
1476impl<T> core::ops::Mul<&MagneticFlux<T>> for &Current<T> where T: NumLike {
1478 type Output = Energy<T>;
1479 fn mul(self, rhs: &MagneticFlux<T>) -> Self::Output {
1480 Energy{J: self.A.clone() * rhs.Wb.clone()}
1481 }
1482}
1483
1484impl<T> core::ops::Div<MagneticFlux<T>> for Current<T> where T: NumLike {
1487 type Output = InverseInductance<T>;
1488 fn div(self, rhs: MagneticFlux<T>) -> Self::Output {
1489 InverseInductance{per_H: self.A / rhs.Wb}
1490 }
1491}
1492impl<T> core::ops::Div<MagneticFlux<T>> for &Current<T> where T: NumLike {
1494 type Output = InverseInductance<T>;
1495 fn div(self, rhs: MagneticFlux<T>) -> Self::Output {
1496 InverseInductance{per_H: self.A.clone() / rhs.Wb}
1497 }
1498}
1499impl<T> core::ops::Div<&MagneticFlux<T>> for Current<T> where T: NumLike {
1501 type Output = InverseInductance<T>;
1502 fn div(self, rhs: &MagneticFlux<T>) -> Self::Output {
1503 InverseInductance{per_H: self.A / rhs.Wb.clone()}
1504 }
1505}
1506impl<T> core::ops::Div<&MagneticFlux<T>> for &Current<T> where T: NumLike {
1508 type Output = InverseInductance<T>;
1509 fn div(self, rhs: &MagneticFlux<T>) -> Self::Output {
1510 InverseInductance{per_H: self.A.clone() / rhs.Wb.clone()}
1511 }
1512}
1513
1514impl<T> core::ops::Mul<Resistance<T>> for Current<T> where T: NumLike {
1517 type Output = Voltage<T>;
1518 fn mul(self, rhs: Resistance<T>) -> Self::Output {
1519 Voltage{V: self.A * rhs.Ohm}
1520 }
1521}
1522impl<T> core::ops::Mul<Resistance<T>> for &Current<T> where T: NumLike {
1524 type Output = Voltage<T>;
1525 fn mul(self, rhs: Resistance<T>) -> Self::Output {
1526 Voltage{V: self.A.clone() * rhs.Ohm}
1527 }
1528}
1529impl<T> core::ops::Mul<&Resistance<T>> for Current<T> where T: NumLike {
1531 type Output = Voltage<T>;
1532 fn mul(self, rhs: &Resistance<T>) -> Self::Output {
1533 Voltage{V: self.A * rhs.Ohm.clone()}
1534 }
1535}
1536impl<T> core::ops::Mul<&Resistance<T>> for &Current<T> where T: NumLike {
1538 type Output = Voltage<T>;
1539 fn mul(self, rhs: &Resistance<T>) -> Self::Output {
1540 Voltage{V: self.A.clone() * rhs.Ohm.clone()}
1541 }
1542}
1543
1544impl<T> core::ops::Mul<Voltage<T>> for Current<T> where T: NumLike {
1547 type Output = Power<T>;
1548 fn mul(self, rhs: Voltage<T>) -> Self::Output {
1549 Power{W: self.A * rhs.V}
1550 }
1551}
1552impl<T> core::ops::Mul<Voltage<T>> for &Current<T> where T: NumLike {
1554 type Output = Power<T>;
1555 fn mul(self, rhs: Voltage<T>) -> Self::Output {
1556 Power{W: self.A.clone() * rhs.V}
1557 }
1558}
1559impl<T> core::ops::Mul<&Voltage<T>> for Current<T> where T: NumLike {
1561 type Output = Power<T>;
1562 fn mul(self, rhs: &Voltage<T>) -> Self::Output {
1563 Power{W: self.A * rhs.V.clone()}
1564 }
1565}
1566impl<T> core::ops::Mul<&Voltage<T>> for &Current<T> where T: NumLike {
1568 type Output = Power<T>;
1569 fn mul(self, rhs: &Voltage<T>) -> Self::Output {
1570 Power{W: self.A.clone() * rhs.V.clone()}
1571 }
1572}
1573
1574impl<T> core::ops::Div<Voltage<T>> for Current<T> where T: NumLike {
1577 type Output = Conductance<T>;
1578 fn div(self, rhs: Voltage<T>) -> Self::Output {
1579 Conductance{S: self.A / rhs.V}
1580 }
1581}
1582impl<T> core::ops::Div<Voltage<T>> for &Current<T> where T: NumLike {
1584 type Output = Conductance<T>;
1585 fn div(self, rhs: Voltage<T>) -> Self::Output {
1586 Conductance{S: self.A.clone() / rhs.V}
1587 }
1588}
1589impl<T> core::ops::Div<&Voltage<T>> for Current<T> where T: NumLike {
1591 type Output = Conductance<T>;
1592 fn div(self, rhs: &Voltage<T>) -> Self::Output {
1593 Conductance{S: self.A / rhs.V.clone()}
1594 }
1595}
1596impl<T> core::ops::Div<&Voltage<T>> for &Current<T> where T: NumLike {
1598 type Output = Conductance<T>;
1599 fn div(self, rhs: &Voltage<T>) -> Self::Output {
1600 Conductance{S: self.A.clone() / rhs.V.clone()}
1601 }
1602}
1603
1604impl<T> core::ops::Div<Energy<T>> for Current<T> where T: NumLike {
1607 type Output = InverseMagneticFlux<T>;
1608 fn div(self, rhs: Energy<T>) -> Self::Output {
1609 InverseMagneticFlux{per_Wb: self.A / rhs.J}
1610 }
1611}
1612impl<T> core::ops::Div<Energy<T>> for &Current<T> where T: NumLike {
1614 type Output = InverseMagneticFlux<T>;
1615 fn div(self, rhs: Energy<T>) -> Self::Output {
1616 InverseMagneticFlux{per_Wb: self.A.clone() / rhs.J}
1617 }
1618}
1619impl<T> core::ops::Div<&Energy<T>> for Current<T> where T: NumLike {
1621 type Output = InverseMagneticFlux<T>;
1622 fn div(self, rhs: &Energy<T>) -> Self::Output {
1623 InverseMagneticFlux{per_Wb: self.A / rhs.J.clone()}
1624 }
1625}
1626impl<T> core::ops::Div<&Energy<T>> for &Current<T> where T: NumLike {
1628 type Output = InverseMagneticFlux<T>;
1629 fn div(self, rhs: &Energy<T>) -> Self::Output {
1630 InverseMagneticFlux{per_Wb: self.A.clone() / rhs.J.clone()}
1631 }
1632}
1633
1634impl<T> core::ops::Div<Torque<T>> for Current<T> where T: NumLike {
1637 type Output = InverseMagneticFlux<T>;
1638 fn div(self, rhs: Torque<T>) -> Self::Output {
1639 InverseMagneticFlux{per_Wb: self.A / rhs.Nm}
1640 }
1641}
1642impl<T> core::ops::Div<Torque<T>> for &Current<T> where T: NumLike {
1644 type Output = InverseMagneticFlux<T>;
1645 fn div(self, rhs: Torque<T>) -> Self::Output {
1646 InverseMagneticFlux{per_Wb: self.A.clone() / rhs.Nm}
1647 }
1648}
1649impl<T> core::ops::Div<&Torque<T>> for Current<T> where T: NumLike {
1651 type Output = InverseMagneticFlux<T>;
1652 fn div(self, rhs: &Torque<T>) -> Self::Output {
1653 InverseMagneticFlux{per_Wb: self.A / rhs.Nm.clone()}
1654 }
1655}
1656impl<T> core::ops::Div<&Torque<T>> for &Current<T> where T: NumLike {
1658 type Output = InverseMagneticFlux<T>;
1659 fn div(self, rhs: &Torque<T>) -> Self::Output {
1660 InverseMagneticFlux{per_Wb: self.A.clone() / rhs.Nm.clone()}
1661 }
1662}
1663
1664impl<T> core::ops::Div<Frequency<T>> for Current<T> where T: NumLike {
1667 type Output = Charge<T>;
1668 fn div(self, rhs: Frequency<T>) -> Self::Output {
1669 Charge{C: self.A / rhs.Hz}
1670 }
1671}
1672impl<T> core::ops::Div<Frequency<T>> for &Current<T> where T: NumLike {
1674 type Output = Charge<T>;
1675 fn div(self, rhs: Frequency<T>) -> Self::Output {
1676 Charge{C: self.A.clone() / rhs.Hz}
1677 }
1678}
1679impl<T> core::ops::Div<&Frequency<T>> for Current<T> where T: NumLike {
1681 type Output = Charge<T>;
1682 fn div(self, rhs: &Frequency<T>) -> Self::Output {
1683 Charge{C: self.A / rhs.Hz.clone()}
1684 }
1685}
1686impl<T> core::ops::Div<&Frequency<T>> for &Current<T> where T: NumLike {
1688 type Output = Charge<T>;
1689 fn div(self, rhs: &Frequency<T>) -> Self::Output {
1690 Charge{C: self.A.clone() / rhs.Hz.clone()}
1691 }
1692}
1693
1694impl<T> core::ops::Mul<InverseEnergy<T>> for Current<T> where T: NumLike {
1697 type Output = InverseMagneticFlux<T>;
1698 fn mul(self, rhs: InverseEnergy<T>) -> Self::Output {
1699 InverseMagneticFlux{per_Wb: self.A * rhs.per_J}
1700 }
1701}
1702impl<T> core::ops::Mul<InverseEnergy<T>> for &Current<T> where T: NumLike {
1704 type Output = InverseMagneticFlux<T>;
1705 fn mul(self, rhs: InverseEnergy<T>) -> Self::Output {
1706 InverseMagneticFlux{per_Wb: self.A.clone() * rhs.per_J}
1707 }
1708}
1709impl<T> core::ops::Mul<&InverseEnergy<T>> for Current<T> where T: NumLike {
1711 type Output = InverseMagneticFlux<T>;
1712 fn mul(self, rhs: &InverseEnergy<T>) -> Self::Output {
1713 InverseMagneticFlux{per_Wb: self.A * rhs.per_J.clone()}
1714 }
1715}
1716impl<T> core::ops::Mul<&InverseEnergy<T>> for &Current<T> where T: NumLike {
1718 type Output = InverseMagneticFlux<T>;
1719 fn mul(self, rhs: &InverseEnergy<T>) -> Self::Output {
1720 InverseMagneticFlux{per_Wb: self.A.clone() * rhs.per_J.clone()}
1721 }
1722}
1723
1724impl<T> core::ops::Mul<InverseTorque<T>> for Current<T> where T: NumLike {
1727 type Output = InverseMagneticFlux<T>;
1728 fn mul(self, rhs: InverseTorque<T>) -> Self::Output {
1729 InverseMagneticFlux{per_Wb: self.A * rhs.per_Nm}
1730 }
1731}
1732impl<T> core::ops::Mul<InverseTorque<T>> for &Current<T> where T: NumLike {
1734 type Output = InverseMagneticFlux<T>;
1735 fn mul(self, rhs: InverseTorque<T>) -> Self::Output {
1736 InverseMagneticFlux{per_Wb: self.A.clone() * rhs.per_Nm}
1737 }
1738}
1739impl<T> core::ops::Mul<&InverseTorque<T>> for Current<T> where T: NumLike {
1741 type Output = InverseMagneticFlux<T>;
1742 fn mul(self, rhs: &InverseTorque<T>) -> Self::Output {
1743 InverseMagneticFlux{per_Wb: self.A * rhs.per_Nm.clone()}
1744 }
1745}
1746impl<T> core::ops::Mul<&InverseTorque<T>> for &Current<T> where T: NumLike {
1748 type Output = InverseMagneticFlux<T>;
1749 fn mul(self, rhs: &InverseTorque<T>) -> Self::Output {
1750 InverseMagneticFlux{per_Wb: self.A.clone() * rhs.per_Nm.clone()}
1751 }
1752}
1753
1754impl<T> core::ops::Mul<InversePower<T>> for Current<T> where T: NumLike {
1757 type Output = InverseVoltage<T>;
1758 fn mul(self, rhs: InversePower<T>) -> Self::Output {
1759 InverseVoltage{per_V: self.A * rhs.per_W}
1760 }
1761}
1762impl<T> core::ops::Mul<InversePower<T>> for &Current<T> where T: NumLike {
1764 type Output = InverseVoltage<T>;
1765 fn mul(self, rhs: InversePower<T>) -> Self::Output {
1766 InverseVoltage{per_V: self.A.clone() * rhs.per_W}
1767 }
1768}
1769impl<T> core::ops::Mul<&InversePower<T>> for Current<T> where T: NumLike {
1771 type Output = InverseVoltage<T>;
1772 fn mul(self, rhs: &InversePower<T>) -> Self::Output {
1773 InverseVoltage{per_V: self.A * rhs.per_W.clone()}
1774 }
1775}
1776impl<T> core::ops::Mul<&InversePower<T>> for &Current<T> where T: NumLike {
1778 type Output = InverseVoltage<T>;
1779 fn mul(self, rhs: &InversePower<T>) -> Self::Output {
1780 InverseVoltage{per_V: self.A.clone() * rhs.per_W.clone()}
1781 }
1782}
1783
1784impl<T> core::ops::Div<Power<T>> for Current<T> where T: NumLike {
1787 type Output = InverseVoltage<T>;
1788 fn div(self, rhs: Power<T>) -> Self::Output {
1789 InverseVoltage{per_V: self.A / rhs.W}
1790 }
1791}
1792impl<T> core::ops::Div<Power<T>> for &Current<T> where T: NumLike {
1794 type Output = InverseVoltage<T>;
1795 fn div(self, rhs: Power<T>) -> Self::Output {
1796 InverseVoltage{per_V: self.A.clone() / rhs.W}
1797 }
1798}
1799impl<T> core::ops::Div<&Power<T>> for Current<T> where T: NumLike {
1801 type Output = InverseVoltage<T>;
1802 fn div(self, rhs: &Power<T>) -> Self::Output {
1803 InverseVoltage{per_V: self.A / rhs.W.clone()}
1804 }
1805}
1806impl<T> core::ops::Div<&Power<T>> for &Current<T> where T: NumLike {
1808 type Output = InverseVoltage<T>;
1809 fn div(self, rhs: &Power<T>) -> Self::Output {
1810 InverseVoltage{per_V: self.A.clone() / rhs.W.clone()}
1811 }
1812}
1813
1814impl<T> core::ops::Div<Current<T>> for f64 where T: NumLike+From<f64> {
1817 type Output = InverseCurrent<T>;
1818 fn div(self, rhs: Current<T>) -> Self::Output {
1819 InverseCurrent{per_A: T::from(self) / rhs.A}
1820 }
1821}
1822impl<T> core::ops::Div<Current<T>> for &f64 where T: NumLike+From<f64> {
1824 type Output = InverseCurrent<T>;
1825 fn div(self, rhs: Current<T>) -> Self::Output {
1826 InverseCurrent{per_A: T::from(self.clone()) / rhs.A}
1827 }
1828}
1829impl<T> core::ops::Div<&Current<T>> for f64 where T: NumLike+From<f64> {
1831 type Output = InverseCurrent<T>;
1832 fn div(self, rhs: &Current<T>) -> Self::Output {
1833 InverseCurrent{per_A: T::from(self) / rhs.A.clone()}
1834 }
1835}
1836impl<T> core::ops::Div<&Current<T>> for &f64 where T: NumLike+From<f64> {
1838 type Output = InverseCurrent<T>;
1839 fn div(self, rhs: &Current<T>) -> Self::Output {
1840 InverseCurrent{per_A: T::from(self.clone()) / rhs.A.clone()}
1841 }
1842}
1843
1844impl<T> core::ops::Div<Current<T>> for f32 where T: NumLike+From<f32> {
1847 type Output = InverseCurrent<T>;
1848 fn div(self, rhs: Current<T>) -> Self::Output {
1849 InverseCurrent{per_A: T::from(self) / rhs.A}
1850 }
1851}
1852impl<T> core::ops::Div<Current<T>> for &f32 where T: NumLike+From<f32> {
1854 type Output = InverseCurrent<T>;
1855 fn div(self, rhs: Current<T>) -> Self::Output {
1856 InverseCurrent{per_A: T::from(self.clone()) / rhs.A}
1857 }
1858}
1859impl<T> core::ops::Div<&Current<T>> for f32 where T: NumLike+From<f32> {
1861 type Output = InverseCurrent<T>;
1862 fn div(self, rhs: &Current<T>) -> Self::Output {
1863 InverseCurrent{per_A: T::from(self) / rhs.A.clone()}
1864 }
1865}
1866impl<T> core::ops::Div<&Current<T>> for &f32 where T: NumLike+From<f32> {
1868 type Output = InverseCurrent<T>;
1869 fn div(self, rhs: &Current<T>) -> Self::Output {
1870 InverseCurrent{per_A: T::from(self.clone()) / rhs.A.clone()}
1871 }
1872}
1873
1874impl<T> core::ops::Div<Current<T>> for i64 where T: NumLike+From<i64> {
1877 type Output = InverseCurrent<T>;
1878 fn div(self, rhs: Current<T>) -> Self::Output {
1879 InverseCurrent{per_A: T::from(self) / rhs.A}
1880 }
1881}
1882impl<T> core::ops::Div<Current<T>> for &i64 where T: NumLike+From<i64> {
1884 type Output = InverseCurrent<T>;
1885 fn div(self, rhs: Current<T>) -> Self::Output {
1886 InverseCurrent{per_A: T::from(self.clone()) / rhs.A}
1887 }
1888}
1889impl<T> core::ops::Div<&Current<T>> for i64 where T: NumLike+From<i64> {
1891 type Output = InverseCurrent<T>;
1892 fn div(self, rhs: &Current<T>) -> Self::Output {
1893 InverseCurrent{per_A: T::from(self) / rhs.A.clone()}
1894 }
1895}
1896impl<T> core::ops::Div<&Current<T>> for &i64 where T: NumLike+From<i64> {
1898 type Output = InverseCurrent<T>;
1899 fn div(self, rhs: &Current<T>) -> Self::Output {
1900 InverseCurrent{per_A: T::from(self.clone()) / rhs.A.clone()}
1901 }
1902}
1903
1904impl<T> core::ops::Div<Current<T>> for i32 where T: NumLike+From<i32> {
1907 type Output = InverseCurrent<T>;
1908 fn div(self, rhs: Current<T>) -> Self::Output {
1909 InverseCurrent{per_A: T::from(self) / rhs.A}
1910 }
1911}
1912impl<T> core::ops::Div<Current<T>> for &i32 where T: NumLike+From<i32> {
1914 type Output = InverseCurrent<T>;
1915 fn div(self, rhs: Current<T>) -> Self::Output {
1916 InverseCurrent{per_A: T::from(self.clone()) / rhs.A}
1917 }
1918}
1919impl<T> core::ops::Div<&Current<T>> for i32 where T: NumLike+From<i32> {
1921 type Output = InverseCurrent<T>;
1922 fn div(self, rhs: &Current<T>) -> Self::Output {
1923 InverseCurrent{per_A: T::from(self) / rhs.A.clone()}
1924 }
1925}
1926impl<T> core::ops::Div<&Current<T>> for &i32 where T: NumLike+From<i32> {
1928 type Output = InverseCurrent<T>;
1929 fn div(self, rhs: &Current<T>) -> Self::Output {
1930 InverseCurrent{per_A: T::from(self.clone()) / rhs.A.clone()}
1931 }
1932}
1933
1934#[cfg(feature="num-bigfloat")]
1937impl<T> core::ops::Div<Current<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
1938 type Output = InverseCurrent<T>;
1939 fn div(self, rhs: Current<T>) -> Self::Output {
1940 InverseCurrent{per_A: T::from(self) / rhs.A}
1941 }
1942}
1943#[cfg(feature="num-bigfloat")]
1945impl<T> core::ops::Div<Current<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
1946 type Output = InverseCurrent<T>;
1947 fn div(self, rhs: Current<T>) -> Self::Output {
1948 InverseCurrent{per_A: T::from(self.clone()) / rhs.A}
1949 }
1950}
1951#[cfg(feature="num-bigfloat")]
1953impl<T> core::ops::Div<&Current<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
1954 type Output = InverseCurrent<T>;
1955 fn div(self, rhs: &Current<T>) -> Self::Output {
1956 InverseCurrent{per_A: T::from(self) / rhs.A.clone()}
1957 }
1958}
1959#[cfg(feature="num-bigfloat")]
1961impl<T> core::ops::Div<&Current<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
1962 type Output = InverseCurrent<T>;
1963 fn div(self, rhs: &Current<T>) -> Self::Output {
1964 InverseCurrent{per_A: T::from(self.clone()) / rhs.A.clone()}
1965 }
1966}
1967
1968#[cfg(feature="num-complex")]
1971impl<T> core::ops::Div<Current<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
1972 type Output = InverseCurrent<T>;
1973 fn div(self, rhs: Current<T>) -> Self::Output {
1974 InverseCurrent{per_A: T::from(self) / rhs.A}
1975 }
1976}
1977#[cfg(feature="num-complex")]
1979impl<T> core::ops::Div<Current<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
1980 type Output = InverseCurrent<T>;
1981 fn div(self, rhs: Current<T>) -> Self::Output {
1982 InverseCurrent{per_A: T::from(self.clone()) / rhs.A}
1983 }
1984}
1985#[cfg(feature="num-complex")]
1987impl<T> core::ops::Div<&Current<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
1988 type Output = InverseCurrent<T>;
1989 fn div(self, rhs: &Current<T>) -> Self::Output {
1990 InverseCurrent{per_A: T::from(self) / rhs.A.clone()}
1991 }
1992}
1993#[cfg(feature="num-complex")]
1995impl<T> core::ops::Div<&Current<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
1996 type Output = InverseCurrent<T>;
1997 fn div(self, rhs: &Current<T>) -> Self::Output {
1998 InverseCurrent{per_A: T::from(self.clone()) / rhs.A.clone()}
1999 }
2000}
2001
2002#[cfg(feature="num-complex")]
2005impl<T> core::ops::Div<Current<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
2006 type Output = InverseCurrent<T>;
2007 fn div(self, rhs: Current<T>) -> Self::Output {
2008 InverseCurrent{per_A: T::from(self) / rhs.A}
2009 }
2010}
2011#[cfg(feature="num-complex")]
2013impl<T> core::ops::Div<Current<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
2014 type Output = InverseCurrent<T>;
2015 fn div(self, rhs: Current<T>) -> Self::Output {
2016 InverseCurrent{per_A: T::from(self.clone()) / rhs.A}
2017 }
2018}
2019#[cfg(feature="num-complex")]
2021impl<T> core::ops::Div<&Current<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
2022 type Output = InverseCurrent<T>;
2023 fn div(self, rhs: &Current<T>) -> Self::Output {
2024 InverseCurrent{per_A: T::from(self) / rhs.A.clone()}
2025 }
2026}
2027#[cfg(feature="num-complex")]
2029impl<T> core::ops::Div<&Current<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
2030 type Output = InverseCurrent<T>;
2031 fn div(self, rhs: &Current<T>) -> Self::Output {
2032 InverseCurrent{per_A: T::from(self.clone()) / rhs.A.clone()}
2033 }
2034}
2035
2036#[derive(UnitStruct, Debug, Clone)]
2038#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
2039pub struct Distance<T: NumLike>{
2040 pub m: T
2042}
2043
2044impl<T> Distance<T> where T: NumLike {
2045
2046 pub fn unit_name() -> &'static str { "meters" }
2048
2049 pub fn unit_symbol() -> &'static str { "m" }
2051
2052 pub fn from_m(m: T) -> Self { Distance{m: m} }
2057
2058 pub fn to_m(&self) -> T { self.m.clone() }
2060
2061 pub fn from_meters(meters: T) -> Self { Distance{m: meters} }
2066
2067 pub fn to_meters(&self) -> T { self.m.clone() }
2069
2070}
2071
2072impl<T> fmt::Display for Distance<T> where T: NumLike {
2073 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2074 write!(f, "{} {}", &self.m, Self::unit_symbol())
2075 }
2076}
2077
2078impl<T> Distance<T> where T: NumLike+From<f64> {
2079
2080 pub fn to_cm(&self) -> T {
2084 return self.m.clone() * T::from(100.0_f64);
2085 }
2086
2087 pub fn from_cm(cm: T) -> Self {
2094 Distance{m: cm * T::from(0.01_f64)}
2095 }
2096
2097 pub fn to_mm(&self) -> T {
2101 return self.m.clone() * T::from(1000.0_f64);
2102 }
2103
2104 pub fn from_mm(mm: T) -> Self {
2111 Distance{m: mm * T::from(0.001_f64)}
2112 }
2113
2114 pub fn to_um(&self) -> T {
2118 return self.m.clone() * T::from(1000000.0_f64);
2119 }
2120
2121 pub fn from_um(um: T) -> Self {
2128 Distance{m: um * T::from(1e-06_f64)}
2129 }
2130
2131 pub fn to_nm(&self) -> T {
2135 return self.m.clone() * T::from(1000000000.0_f64);
2136 }
2137
2138 pub fn from_nm(nm: T) -> Self {
2145 Distance{m: nm * T::from(1e-09_f64)}
2146 }
2147
2148 pub fn to_pm(&self) -> T {
2152 return self.m.clone() * T::from(1000000000000.0_f64);
2153 }
2154
2155 pub fn from_pm(pm: T) -> Self {
2162 Distance{m: pm * T::from(1e-12_f64)}
2163 }
2164
2165 pub fn to_km(&self) -> T {
2169 return self.m.clone() * T::from(0.001_f64);
2170 }
2171
2172 pub fn from_km(km: T) -> Self {
2179 Distance{m: km * T::from(1000.0_f64)}
2180 }
2181
2182 pub fn to_au(&self) -> T {
2186 return self.m.clone() * T::from(6.68458712226845e-12_f64);
2187 }
2188
2189 pub fn from_au(au: T) -> Self {
2196 Distance{m: au * T::from(149597870700.0_f64)}
2197 }
2198
2199 pub fn to_parsec(&self) -> T {
2203 return self.m.clone() * T::from(3.24077624525171e-17_f64);
2204 }
2205
2206 pub fn from_parsec(parsec: T) -> Self {
2213 Distance{m: parsec * T::from(3.08568047999355e+16_f64)}
2214 }
2215
2216 pub fn to_lyr(&self) -> T {
2220 return self.m.clone() * T::from(1.05702343681763e-16_f64);
2221 }
2222
2223 pub fn from_lyr(lyr: T) -> Self {
2230 Distance{m: lyr * T::from(9460528169656200.0_f64)}
2231 }
2232
2233}
2234
2235
2236#[cfg(feature="num-bigfloat")]
2238impl core::ops::Mul<Distance<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
2239 type Output = Distance<num_bigfloat::BigFloat>;
2240 fn mul(self, rhs: Distance<num_bigfloat::BigFloat>) -> Self::Output {
2241 Distance{m: self * rhs.m}
2242 }
2243}
2244#[cfg(feature="num-bigfloat")]
2246impl core::ops::Mul<Distance<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
2247 type Output = Distance<num_bigfloat::BigFloat>;
2248 fn mul(self, rhs: Distance<num_bigfloat::BigFloat>) -> Self::Output {
2249 Distance{m: self.clone() * rhs.m}
2250 }
2251}
2252#[cfg(feature="num-bigfloat")]
2254impl core::ops::Mul<&Distance<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
2255 type Output = Distance<num_bigfloat::BigFloat>;
2256 fn mul(self, rhs: &Distance<num_bigfloat::BigFloat>) -> Self::Output {
2257 Distance{m: self * rhs.m.clone()}
2258 }
2259}
2260#[cfg(feature="num-bigfloat")]
2262impl core::ops::Mul<&Distance<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
2263 type Output = Distance<num_bigfloat::BigFloat>;
2264 fn mul(self, rhs: &Distance<num_bigfloat::BigFloat>) -> Self::Output {
2265 Distance{m: self.clone() * rhs.m.clone()}
2266 }
2267}
2268
2269#[cfg(feature="num-complex")]
2271impl core::ops::Mul<Distance<num_complex::Complex32>> for num_complex::Complex32 {
2272 type Output = Distance<num_complex::Complex32>;
2273 fn mul(self, rhs: Distance<num_complex::Complex32>) -> Self::Output {
2274 Distance{m: self * rhs.m}
2275 }
2276}
2277#[cfg(feature="num-complex")]
2279impl core::ops::Mul<Distance<num_complex::Complex32>> for &num_complex::Complex32 {
2280 type Output = Distance<num_complex::Complex32>;
2281 fn mul(self, rhs: Distance<num_complex::Complex32>) -> Self::Output {
2282 Distance{m: self.clone() * rhs.m}
2283 }
2284}
2285#[cfg(feature="num-complex")]
2287impl core::ops::Mul<&Distance<num_complex::Complex32>> for num_complex::Complex32 {
2288 type Output = Distance<num_complex::Complex32>;
2289 fn mul(self, rhs: &Distance<num_complex::Complex32>) -> Self::Output {
2290 Distance{m: self * rhs.m.clone()}
2291 }
2292}
2293#[cfg(feature="num-complex")]
2295impl core::ops::Mul<&Distance<num_complex::Complex32>> for &num_complex::Complex32 {
2296 type Output = Distance<num_complex::Complex32>;
2297 fn mul(self, rhs: &Distance<num_complex::Complex32>) -> Self::Output {
2298 Distance{m: self.clone() * rhs.m.clone()}
2299 }
2300}
2301
2302#[cfg(feature="num-complex")]
2304impl core::ops::Mul<Distance<num_complex::Complex64>> for num_complex::Complex64 {
2305 type Output = Distance<num_complex::Complex64>;
2306 fn mul(self, rhs: Distance<num_complex::Complex64>) -> Self::Output {
2307 Distance{m: self * rhs.m}
2308 }
2309}
2310#[cfg(feature="num-complex")]
2312impl core::ops::Mul<Distance<num_complex::Complex64>> for &num_complex::Complex64 {
2313 type Output = Distance<num_complex::Complex64>;
2314 fn mul(self, rhs: Distance<num_complex::Complex64>) -> Self::Output {
2315 Distance{m: self.clone() * rhs.m}
2316 }
2317}
2318#[cfg(feature="num-complex")]
2320impl core::ops::Mul<&Distance<num_complex::Complex64>> for num_complex::Complex64 {
2321 type Output = Distance<num_complex::Complex64>;
2322 fn mul(self, rhs: &Distance<num_complex::Complex64>) -> Self::Output {
2323 Distance{m: self * rhs.m.clone()}
2324 }
2325}
2326#[cfg(feature="num-complex")]
2328impl core::ops::Mul<&Distance<num_complex::Complex64>> for &num_complex::Complex64 {
2329 type Output = Distance<num_complex::Complex64>;
2330 fn mul(self, rhs: &Distance<num_complex::Complex64>) -> Self::Output {
2331 Distance{m: self.clone() * rhs.m.clone()}
2332 }
2333}
2334
2335
2336
2337#[cfg(feature = "uom")]
2339impl<T> Into<uom::si::f32::Length> for Distance<T> where T: NumLike+Into<f32> {
2340 fn into(self) -> uom::si::f32::Length {
2341 uom::si::f32::Length::new::<uom::si::length::meter>(self.m.into())
2342 }
2343}
2344
2345#[cfg(feature = "uom")]
2347impl<T> From<uom::si::f32::Length> for Distance<T> where T: NumLike+From<f32> {
2348 fn from(src: uom::si::f32::Length) -> Self {
2349 Distance{m: T::from(src.value)}
2350 }
2351}
2352
2353#[cfg(feature = "uom")]
2355impl<T> Into<uom::si::f64::Length> for Distance<T> where T: NumLike+Into<f64> {
2356 fn into(self) -> uom::si::f64::Length {
2357 uom::si::f64::Length::new::<uom::si::length::meter>(self.m.into())
2358 }
2359}
2360
2361#[cfg(feature = "uom")]
2363impl<T> From<uom::si::f64::Length> for Distance<T> where T: NumLike+From<f64> {
2364 fn from(src: uom::si::f64::Length) -> Self {
2365 Distance{m: T::from(src.value)}
2366 }
2367}
2368
2369
2370impl<T> core::ops::Mul<Distance<T>> for Distance<T> where T: NumLike {
2373 type Output = Area<T>;
2374 fn mul(self, rhs: Distance<T>) -> Self::Output {
2375 Area{m2: self.m * rhs.m}
2376 }
2377}
2378impl<T> core::ops::Mul<Distance<T>> for &Distance<T> where T: NumLike {
2380 type Output = Area<T>;
2381 fn mul(self, rhs: Distance<T>) -> Self::Output {
2382 Area{m2: self.m.clone() * rhs.m}
2383 }
2384}
2385impl<T> core::ops::Mul<&Distance<T>> for Distance<T> where T: NumLike {
2387 type Output = Area<T>;
2388 fn mul(self, rhs: &Distance<T>) -> Self::Output {
2389 Area{m2: self.m * rhs.m.clone()}
2390 }
2391}
2392impl<T> core::ops::Mul<&Distance<T>> for &Distance<T> where T: NumLike {
2394 type Output = Area<T>;
2395 fn mul(self, rhs: &Distance<T>) -> Self::Output {
2396 Area{m2: self.m.clone() * rhs.m.clone()}
2397 }
2398}
2399
2400impl<T> core::ops::Div<InverseDistance<T>> for Distance<T> where T: NumLike {
2403 type Output = Area<T>;
2404 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
2405 Area{m2: self.m / rhs.per_m}
2406 }
2407}
2408impl<T> core::ops::Div<InverseDistance<T>> for &Distance<T> where T: NumLike {
2410 type Output = Area<T>;
2411 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
2412 Area{m2: self.m.clone() / rhs.per_m}
2413 }
2414}
2415impl<T> core::ops::Div<&InverseDistance<T>> for Distance<T> where T: NumLike {
2417 type Output = Area<T>;
2418 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
2419 Area{m2: self.m / rhs.per_m.clone()}
2420 }
2421}
2422impl<T> core::ops::Div<&InverseDistance<T>> for &Distance<T> where T: NumLike {
2424 type Output = Area<T>;
2425 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
2426 Area{m2: self.m.clone() / rhs.per_m.clone()}
2427 }
2428}
2429
2430impl<T> core::ops::Div<Time<T>> for Distance<T> where T: NumLike {
2433 type Output = Velocity<T>;
2434 fn div(self, rhs: Time<T>) -> Self::Output {
2435 Velocity{mps: self.m / rhs.s}
2436 }
2437}
2438impl<T> core::ops::Div<Time<T>> for &Distance<T> where T: NumLike {
2440 type Output = Velocity<T>;
2441 fn div(self, rhs: Time<T>) -> Self::Output {
2442 Velocity{mps: self.m.clone() / rhs.s}
2443 }
2444}
2445impl<T> core::ops::Div<&Time<T>> for Distance<T> where T: NumLike {
2447 type Output = Velocity<T>;
2448 fn div(self, rhs: &Time<T>) -> Self::Output {
2449 Velocity{mps: self.m / rhs.s.clone()}
2450 }
2451}
2452impl<T> core::ops::Div<&Time<T>> for &Distance<T> where T: NumLike {
2454 type Output = Velocity<T>;
2455 fn div(self, rhs: &Time<T>) -> Self::Output {
2456 Velocity{mps: self.m.clone() / rhs.s.clone()}
2457 }
2458}
2459
2460impl<T> core::ops::Mul<Area<T>> for Distance<T> where T: NumLike {
2463 type Output = Volume<T>;
2464 fn mul(self, rhs: Area<T>) -> Self::Output {
2465 Volume{m3: self.m * rhs.m2}
2466 }
2467}
2468impl<T> core::ops::Mul<Area<T>> for &Distance<T> where T: NumLike {
2470 type Output = Volume<T>;
2471 fn mul(self, rhs: Area<T>) -> Self::Output {
2472 Volume{m3: self.m.clone() * rhs.m2}
2473 }
2474}
2475impl<T> core::ops::Mul<&Area<T>> for Distance<T> where T: NumLike {
2477 type Output = Volume<T>;
2478 fn mul(self, rhs: &Area<T>) -> Self::Output {
2479 Volume{m3: self.m * rhs.m2.clone()}
2480 }
2481}
2482impl<T> core::ops::Mul<&Area<T>> for &Distance<T> where T: NumLike {
2484 type Output = Volume<T>;
2485 fn mul(self, rhs: &Area<T>) -> Self::Output {
2486 Volume{m3: self.m.clone() * rhs.m2.clone()}
2487 }
2488}
2489
2490impl<T> core::ops::Div<Area<T>> for Distance<T> where T: NumLike {
2493 type Output = InverseDistance<T>;
2494 fn div(self, rhs: Area<T>) -> Self::Output {
2495 InverseDistance{per_m: self.m / rhs.m2}
2496 }
2497}
2498impl<T> core::ops::Div<Area<T>> for &Distance<T> where T: NumLike {
2500 type Output = InverseDistance<T>;
2501 fn div(self, rhs: Area<T>) -> Self::Output {
2502 InverseDistance{per_m: self.m.clone() / rhs.m2}
2503 }
2504}
2505impl<T> core::ops::Div<&Area<T>> for Distance<T> where T: NumLike {
2507 type Output = InverseDistance<T>;
2508 fn div(self, rhs: &Area<T>) -> Self::Output {
2509 InverseDistance{per_m: self.m / rhs.m2.clone()}
2510 }
2511}
2512impl<T> core::ops::Div<&Area<T>> for &Distance<T> where T: NumLike {
2514 type Output = InverseDistance<T>;
2515 fn div(self, rhs: &Area<T>) -> Self::Output {
2516 InverseDistance{per_m: self.m.clone() / rhs.m2.clone()}
2517 }
2518}
2519
2520impl<T> core::ops::Mul<InverseArea<T>> for Distance<T> where T: NumLike {
2523 type Output = InverseDistance<T>;
2524 fn mul(self, rhs: InverseArea<T>) -> Self::Output {
2525 InverseDistance{per_m: self.m * rhs.per_m2}
2526 }
2527}
2528impl<T> core::ops::Mul<InverseArea<T>> for &Distance<T> where T: NumLike {
2530 type Output = InverseDistance<T>;
2531 fn mul(self, rhs: InverseArea<T>) -> Self::Output {
2532 InverseDistance{per_m: self.m.clone() * rhs.per_m2}
2533 }
2534}
2535impl<T> core::ops::Mul<&InverseArea<T>> for Distance<T> where T: NumLike {
2537 type Output = InverseDistance<T>;
2538 fn mul(self, rhs: &InverseArea<T>) -> Self::Output {
2539 InverseDistance{per_m: self.m * rhs.per_m2.clone()}
2540 }
2541}
2542impl<T> core::ops::Mul<&InverseArea<T>> for &Distance<T> where T: NumLike {
2544 type Output = InverseDistance<T>;
2545 fn mul(self, rhs: &InverseArea<T>) -> Self::Output {
2546 InverseDistance{per_m: self.m.clone() * rhs.per_m2.clone()}
2547 }
2548}
2549
2550impl<T> core::ops::Div<InverseArea<T>> for Distance<T> where T: NumLike {
2553 type Output = Volume<T>;
2554 fn div(self, rhs: InverseArea<T>) -> Self::Output {
2555 Volume{m3: self.m / rhs.per_m2}
2556 }
2557}
2558impl<T> core::ops::Div<InverseArea<T>> for &Distance<T> where T: NumLike {
2560 type Output = Volume<T>;
2561 fn div(self, rhs: InverseArea<T>) -> Self::Output {
2562 Volume{m3: self.m.clone() / rhs.per_m2}
2563 }
2564}
2565impl<T> core::ops::Div<&InverseArea<T>> for Distance<T> where T: NumLike {
2567 type Output = Volume<T>;
2568 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
2569 Volume{m3: self.m / rhs.per_m2.clone()}
2570 }
2571}
2572impl<T> core::ops::Div<&InverseArea<T>> for &Distance<T> where T: NumLike {
2574 type Output = Volume<T>;
2575 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
2576 Volume{m3: self.m.clone() / rhs.per_m2.clone()}
2577 }
2578}
2579
2580impl<T> core::ops::Mul<InverseVolume<T>> for Distance<T> where T: NumLike {
2583 type Output = InverseArea<T>;
2584 fn mul(self, rhs: InverseVolume<T>) -> Self::Output {
2585 InverseArea{per_m2: self.m * rhs.per_m3}
2586 }
2587}
2588impl<T> core::ops::Mul<InverseVolume<T>> for &Distance<T> where T: NumLike {
2590 type Output = InverseArea<T>;
2591 fn mul(self, rhs: InverseVolume<T>) -> Self::Output {
2592 InverseArea{per_m2: self.m.clone() * rhs.per_m3}
2593 }
2594}
2595impl<T> core::ops::Mul<&InverseVolume<T>> for Distance<T> where T: NumLike {
2597 type Output = InverseArea<T>;
2598 fn mul(self, rhs: &InverseVolume<T>) -> Self::Output {
2599 InverseArea{per_m2: self.m * rhs.per_m3.clone()}
2600 }
2601}
2602impl<T> core::ops::Mul<&InverseVolume<T>> for &Distance<T> where T: NumLike {
2604 type Output = InverseArea<T>;
2605 fn mul(self, rhs: &InverseVolume<T>) -> Self::Output {
2606 InverseArea{per_m2: self.m.clone() * rhs.per_m3.clone()}
2607 }
2608}
2609
2610impl<T> core::ops::Div<Volume<T>> for Distance<T> where T: NumLike {
2613 type Output = InverseArea<T>;
2614 fn div(self, rhs: Volume<T>) -> Self::Output {
2615 InverseArea{per_m2: self.m / rhs.m3}
2616 }
2617}
2618impl<T> core::ops::Div<Volume<T>> for &Distance<T> where T: NumLike {
2620 type Output = InverseArea<T>;
2621 fn div(self, rhs: Volume<T>) -> Self::Output {
2622 InverseArea{per_m2: self.m.clone() / rhs.m3}
2623 }
2624}
2625impl<T> core::ops::Div<&Volume<T>> for Distance<T> where T: NumLike {
2627 type Output = InverseArea<T>;
2628 fn div(self, rhs: &Volume<T>) -> Self::Output {
2629 InverseArea{per_m2: self.m / rhs.m3.clone()}
2630 }
2631}
2632impl<T> core::ops::Div<&Volume<T>> for &Distance<T> where T: NumLike {
2634 type Output = InverseArea<T>;
2635 fn div(self, rhs: &Volume<T>) -> Self::Output {
2636 InverseArea{per_m2: self.m.clone() / rhs.m3.clone()}
2637 }
2638}
2639
2640impl<T> core::ops::Div<AreaDensity<T>> for Distance<T> where T: NumLike {
2643 type Output = VolumePerMass<T>;
2644 fn div(self, rhs: AreaDensity<T>) -> Self::Output {
2645 VolumePerMass{m3_per_kg: self.m / rhs.kgpm2}
2646 }
2647}
2648impl<T> core::ops::Div<AreaDensity<T>> for &Distance<T> where T: NumLike {
2650 type Output = VolumePerMass<T>;
2651 fn div(self, rhs: AreaDensity<T>) -> Self::Output {
2652 VolumePerMass{m3_per_kg: self.m.clone() / rhs.kgpm2}
2653 }
2654}
2655impl<T> core::ops::Div<&AreaDensity<T>> for Distance<T> where T: NumLike {
2657 type Output = VolumePerMass<T>;
2658 fn div(self, rhs: &AreaDensity<T>) -> Self::Output {
2659 VolumePerMass{m3_per_kg: self.m / rhs.kgpm2.clone()}
2660 }
2661}
2662impl<T> core::ops::Div<&AreaDensity<T>> for &Distance<T> where T: NumLike {
2664 type Output = VolumePerMass<T>;
2665 fn div(self, rhs: &AreaDensity<T>) -> Self::Output {
2666 VolumePerMass{m3_per_kg: self.m.clone() / rhs.kgpm2.clone()}
2667 }
2668}
2669
2670impl<T> core::ops::Mul<AreaPerMass<T>> for Distance<T> where T: NumLike {
2673 type Output = VolumePerMass<T>;
2674 fn mul(self, rhs: AreaPerMass<T>) -> Self::Output {
2675 VolumePerMass{m3_per_kg: self.m * rhs.m2_per_kg}
2676 }
2677}
2678impl<T> core::ops::Mul<AreaPerMass<T>> for &Distance<T> where T: NumLike {
2680 type Output = VolumePerMass<T>;
2681 fn mul(self, rhs: AreaPerMass<T>) -> Self::Output {
2682 VolumePerMass{m3_per_kg: self.m.clone() * rhs.m2_per_kg}
2683 }
2684}
2685impl<T> core::ops::Mul<&AreaPerMass<T>> for Distance<T> where T: NumLike {
2687 type Output = VolumePerMass<T>;
2688 fn mul(self, rhs: &AreaPerMass<T>) -> Self::Output {
2689 VolumePerMass{m3_per_kg: self.m * rhs.m2_per_kg.clone()}
2690 }
2691}
2692impl<T> core::ops::Mul<&AreaPerMass<T>> for &Distance<T> where T: NumLike {
2694 type Output = VolumePerMass<T>;
2695 fn mul(self, rhs: &AreaPerMass<T>) -> Self::Output {
2696 VolumePerMass{m3_per_kg: self.m.clone() * rhs.m2_per_kg.clone()}
2697 }
2698}
2699
2700impl<T> core::ops::Mul<Density<T>> for Distance<T> where T: NumLike {
2703 type Output = AreaDensity<T>;
2704 fn mul(self, rhs: Density<T>) -> Self::Output {
2705 AreaDensity{kgpm2: self.m * rhs.kgpm3}
2706 }
2707}
2708impl<T> core::ops::Mul<Density<T>> for &Distance<T> where T: NumLike {
2710 type Output = AreaDensity<T>;
2711 fn mul(self, rhs: Density<T>) -> Self::Output {
2712 AreaDensity{kgpm2: self.m.clone() * rhs.kgpm3}
2713 }
2714}
2715impl<T> core::ops::Mul<&Density<T>> for Distance<T> where T: NumLike {
2717 type Output = AreaDensity<T>;
2718 fn mul(self, rhs: &Density<T>) -> Self::Output {
2719 AreaDensity{kgpm2: self.m * rhs.kgpm3.clone()}
2720 }
2721}
2722impl<T> core::ops::Mul<&Density<T>> for &Distance<T> where T: NumLike {
2724 type Output = AreaDensity<T>;
2725 fn mul(self, rhs: &Density<T>) -> Self::Output {
2726 AreaDensity{kgpm2: self.m.clone() * rhs.kgpm3.clone()}
2727 }
2728}
2729
2730impl<T> core::ops::Div<Energy<T>> for Distance<T> where T: NumLike {
2733 type Output = InverseForce<T>;
2734 fn div(self, rhs: Energy<T>) -> Self::Output {
2735 InverseForce{per_N: self.m / rhs.J}
2736 }
2737}
2738impl<T> core::ops::Div<Energy<T>> for &Distance<T> where T: NumLike {
2740 type Output = InverseForce<T>;
2741 fn div(self, rhs: Energy<T>) -> Self::Output {
2742 InverseForce{per_N: self.m.clone() / rhs.J}
2743 }
2744}
2745impl<T> core::ops::Div<&Energy<T>> for Distance<T> where T: NumLike {
2747 type Output = InverseForce<T>;
2748 fn div(self, rhs: &Energy<T>) -> Self::Output {
2749 InverseForce{per_N: self.m / rhs.J.clone()}
2750 }
2751}
2752impl<T> core::ops::Div<&Energy<T>> for &Distance<T> where T: NumLike {
2754 type Output = InverseForce<T>;
2755 fn div(self, rhs: &Energy<T>) -> Self::Output {
2756 InverseForce{per_N: self.m.clone() / rhs.J.clone()}
2757 }
2758}
2759
2760impl<T> core::ops::Div<Torque<T>> for Distance<T> where T: NumLike {
2763 type Output = InverseForce<T>;
2764 fn div(self, rhs: Torque<T>) -> Self::Output {
2765 InverseForce{per_N: self.m / rhs.Nm}
2766 }
2767}
2768impl<T> core::ops::Div<Torque<T>> for &Distance<T> where T: NumLike {
2770 type Output = InverseForce<T>;
2771 fn div(self, rhs: Torque<T>) -> Self::Output {
2772 InverseForce{per_N: self.m.clone() / rhs.Nm}
2773 }
2774}
2775impl<T> core::ops::Div<&Torque<T>> for Distance<T> where T: NumLike {
2777 type Output = InverseForce<T>;
2778 fn div(self, rhs: &Torque<T>) -> Self::Output {
2779 InverseForce{per_N: self.m / rhs.Nm.clone()}
2780 }
2781}
2782impl<T> core::ops::Div<&Torque<T>> for &Distance<T> where T: NumLike {
2784 type Output = InverseForce<T>;
2785 fn div(self, rhs: &Torque<T>) -> Self::Output {
2786 InverseForce{per_N: self.m.clone() / rhs.Nm.clone()}
2787 }
2788}
2789
2790impl<T> core::ops::Mul<Force<T>> for Distance<T> where T: NumLike {
2793 type Output = Energy<T>;
2794 fn mul(self, rhs: Force<T>) -> Self::Output {
2795 Energy{J: self.m * rhs.N}
2796 }
2797}
2798impl<T> core::ops::Mul<Force<T>> for &Distance<T> where T: NumLike {
2800 type Output = Energy<T>;
2801 fn mul(self, rhs: Force<T>) -> Self::Output {
2802 Energy{J: self.m.clone() * rhs.N}
2803 }
2804}
2805impl<T> core::ops::Mul<&Force<T>> for Distance<T> where T: NumLike {
2807 type Output = Energy<T>;
2808 fn mul(self, rhs: &Force<T>) -> Self::Output {
2809 Energy{J: self.m * rhs.N.clone()}
2810 }
2811}
2812impl<T> core::ops::Mul<&Force<T>> for &Distance<T> where T: NumLike {
2814 type Output = Energy<T>;
2815 fn mul(self, rhs: &Force<T>) -> Self::Output {
2816 Energy{J: self.m.clone() * rhs.N.clone()}
2817 }
2818}
2819
2820impl<T> core::ops::Mul<Frequency<T>> for Distance<T> where T: NumLike {
2823 type Output = Velocity<T>;
2824 fn mul(self, rhs: Frequency<T>) -> Self::Output {
2825 Velocity{mps: self.m * rhs.Hz}
2826 }
2827}
2828impl<T> core::ops::Mul<Frequency<T>> for &Distance<T> where T: NumLike {
2830 type Output = Velocity<T>;
2831 fn mul(self, rhs: Frequency<T>) -> Self::Output {
2832 Velocity{mps: self.m.clone() * rhs.Hz}
2833 }
2834}
2835impl<T> core::ops::Mul<&Frequency<T>> for Distance<T> where T: NumLike {
2837 type Output = Velocity<T>;
2838 fn mul(self, rhs: &Frequency<T>) -> Self::Output {
2839 Velocity{mps: self.m * rhs.Hz.clone()}
2840 }
2841}
2842impl<T> core::ops::Mul<&Frequency<T>> for &Distance<T> where T: NumLike {
2844 type Output = Velocity<T>;
2845 fn mul(self, rhs: &Frequency<T>) -> Self::Output {
2846 Velocity{mps: self.m.clone() * rhs.Hz.clone()}
2847 }
2848}
2849
2850impl<T> core::ops::Mul<InverseEnergy<T>> for Distance<T> where T: NumLike {
2853 type Output = InverseForce<T>;
2854 fn mul(self, rhs: InverseEnergy<T>) -> Self::Output {
2855 InverseForce{per_N: self.m * rhs.per_J}
2856 }
2857}
2858impl<T> core::ops::Mul<InverseEnergy<T>> for &Distance<T> where T: NumLike {
2860 type Output = InverseForce<T>;
2861 fn mul(self, rhs: InverseEnergy<T>) -> Self::Output {
2862 InverseForce{per_N: self.m.clone() * rhs.per_J}
2863 }
2864}
2865impl<T> core::ops::Mul<&InverseEnergy<T>> for Distance<T> where T: NumLike {
2867 type Output = InverseForce<T>;
2868 fn mul(self, rhs: &InverseEnergy<T>) -> Self::Output {
2869 InverseForce{per_N: self.m * rhs.per_J.clone()}
2870 }
2871}
2872impl<T> core::ops::Mul<&InverseEnergy<T>> for &Distance<T> where T: NumLike {
2874 type Output = InverseForce<T>;
2875 fn mul(self, rhs: &InverseEnergy<T>) -> Self::Output {
2876 InverseForce{per_N: self.m.clone() * rhs.per_J.clone()}
2877 }
2878}
2879
2880impl<T> core::ops::Mul<InverseTorque<T>> for Distance<T> where T: NumLike {
2883 type Output = InverseForce<T>;
2884 fn mul(self, rhs: InverseTorque<T>) -> Self::Output {
2885 InverseForce{per_N: self.m * rhs.per_Nm}
2886 }
2887}
2888impl<T> core::ops::Mul<InverseTorque<T>> for &Distance<T> where T: NumLike {
2890 type Output = InverseForce<T>;
2891 fn mul(self, rhs: InverseTorque<T>) -> Self::Output {
2892 InverseForce{per_N: self.m.clone() * rhs.per_Nm}
2893 }
2894}
2895impl<T> core::ops::Mul<&InverseTorque<T>> for Distance<T> where T: NumLike {
2897 type Output = InverseForce<T>;
2898 fn mul(self, rhs: &InverseTorque<T>) -> Self::Output {
2899 InverseForce{per_N: self.m * rhs.per_Nm.clone()}
2900 }
2901}
2902impl<T> core::ops::Mul<&InverseTorque<T>> for &Distance<T> where T: NumLike {
2904 type Output = InverseForce<T>;
2905 fn mul(self, rhs: &InverseTorque<T>) -> Self::Output {
2906 InverseForce{per_N: self.m.clone() * rhs.per_Nm.clone()}
2907 }
2908}
2909
2910impl<T> core::ops::Div<InverseForce<T>> for Distance<T> where T: NumLike {
2913 type Output = Energy<T>;
2914 fn div(self, rhs: InverseForce<T>) -> Self::Output {
2915 Energy{J: self.m / rhs.per_N}
2916 }
2917}
2918impl<T> core::ops::Div<InverseForce<T>> for &Distance<T> where T: NumLike {
2920 type Output = Energy<T>;
2921 fn div(self, rhs: InverseForce<T>) -> Self::Output {
2922 Energy{J: self.m.clone() / rhs.per_N}
2923 }
2924}
2925impl<T> core::ops::Div<&InverseForce<T>> for Distance<T> where T: NumLike {
2927 type Output = Energy<T>;
2928 fn div(self, rhs: &InverseForce<T>) -> Self::Output {
2929 Energy{J: self.m / rhs.per_N.clone()}
2930 }
2931}
2932impl<T> core::ops::Div<&InverseForce<T>> for &Distance<T> where T: NumLike {
2934 type Output = Energy<T>;
2935 fn div(self, rhs: &InverseForce<T>) -> Self::Output {
2936 Energy{J: self.m.clone() / rhs.per_N.clone()}
2937 }
2938}
2939
2940impl<T> core::ops::Mul<TimePerDistance<T>> for Distance<T> where T: NumLike {
2943 type Output = Time<T>;
2944 fn mul(self, rhs: TimePerDistance<T>) -> Self::Output {
2945 Time{s: self.m * rhs.spm}
2946 }
2947}
2948impl<T> core::ops::Mul<TimePerDistance<T>> for &Distance<T> where T: NumLike {
2950 type Output = Time<T>;
2951 fn mul(self, rhs: TimePerDistance<T>) -> Self::Output {
2952 Time{s: self.m.clone() * rhs.spm}
2953 }
2954}
2955impl<T> core::ops::Mul<&TimePerDistance<T>> for Distance<T> where T: NumLike {
2957 type Output = Time<T>;
2958 fn mul(self, rhs: &TimePerDistance<T>) -> Self::Output {
2959 Time{s: self.m * rhs.spm.clone()}
2960 }
2961}
2962impl<T> core::ops::Mul<&TimePerDistance<T>> for &Distance<T> where T: NumLike {
2964 type Output = Time<T>;
2965 fn mul(self, rhs: &TimePerDistance<T>) -> Self::Output {
2966 Time{s: self.m.clone() * rhs.spm.clone()}
2967 }
2968}
2969
2970impl<T> core::ops::Div<Velocity<T>> for Distance<T> where T: NumLike {
2973 type Output = Time<T>;
2974 fn div(self, rhs: Velocity<T>) -> Self::Output {
2975 Time{s: self.m / rhs.mps}
2976 }
2977}
2978impl<T> core::ops::Div<Velocity<T>> for &Distance<T> where T: NumLike {
2980 type Output = Time<T>;
2981 fn div(self, rhs: Velocity<T>) -> Self::Output {
2982 Time{s: self.m.clone() / rhs.mps}
2983 }
2984}
2985impl<T> core::ops::Div<&Velocity<T>> for Distance<T> where T: NumLike {
2987 type Output = Time<T>;
2988 fn div(self, rhs: &Velocity<T>) -> Self::Output {
2989 Time{s: self.m / rhs.mps.clone()}
2990 }
2991}
2992impl<T> core::ops::Div<&Velocity<T>> for &Distance<T> where T: NumLike {
2994 type Output = Time<T>;
2995 fn div(self, rhs: &Velocity<T>) -> Self::Output {
2996 Time{s: self.m.clone() / rhs.mps.clone()}
2997 }
2998}
2999
3000impl<T> core::ops::Div<VolumePerMass<T>> for Distance<T> where T: NumLike {
3003 type Output = AreaDensity<T>;
3004 fn div(self, rhs: VolumePerMass<T>) -> Self::Output {
3005 AreaDensity{kgpm2: self.m / rhs.m3_per_kg}
3006 }
3007}
3008impl<T> core::ops::Div<VolumePerMass<T>> for &Distance<T> where T: NumLike {
3010 type Output = AreaDensity<T>;
3011 fn div(self, rhs: VolumePerMass<T>) -> Self::Output {
3012 AreaDensity{kgpm2: self.m.clone() / rhs.m3_per_kg}
3013 }
3014}
3015impl<T> core::ops::Div<&VolumePerMass<T>> for Distance<T> where T: NumLike {
3017 type Output = AreaDensity<T>;
3018 fn div(self, rhs: &VolumePerMass<T>) -> Self::Output {
3019 AreaDensity{kgpm2: self.m / rhs.m3_per_kg.clone()}
3020 }
3021}
3022impl<T> core::ops::Div<&VolumePerMass<T>> for &Distance<T> where T: NumLike {
3024 type Output = AreaDensity<T>;
3025 fn div(self, rhs: &VolumePerMass<T>) -> Self::Output {
3026 AreaDensity{kgpm2: self.m.clone() / rhs.m3_per_kg.clone()}
3027 }
3028}
3029
3030impl<T> core::ops::Mul<InverseAbsorbedDose<T>> for Distance<T> where T: NumLike {
3033 type Output = InverseAcceleration<T>;
3034 fn mul(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
3035 InverseAcceleration{s2pm: self.m * rhs.per_Gy}
3036 }
3037}
3038impl<T> core::ops::Mul<InverseAbsorbedDose<T>> for &Distance<T> where T: NumLike {
3040 type Output = InverseAcceleration<T>;
3041 fn mul(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
3042 InverseAcceleration{s2pm: self.m.clone() * rhs.per_Gy}
3043 }
3044}
3045impl<T> core::ops::Mul<&InverseAbsorbedDose<T>> for Distance<T> where T: NumLike {
3047 type Output = InverseAcceleration<T>;
3048 fn mul(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
3049 InverseAcceleration{s2pm: self.m * rhs.per_Gy.clone()}
3050 }
3051}
3052impl<T> core::ops::Mul<&InverseAbsorbedDose<T>> for &Distance<T> where T: NumLike {
3054 type Output = InverseAcceleration<T>;
3055 fn mul(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
3056 InverseAcceleration{s2pm: self.m.clone() * rhs.per_Gy.clone()}
3057 }
3058}
3059
3060impl<T> core::ops::Mul<InverseDoseEquivalent<T>> for Distance<T> where T: NumLike {
3063 type Output = InverseAcceleration<T>;
3064 fn mul(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
3065 InverseAcceleration{s2pm: self.m * rhs.per_Sv}
3066 }
3067}
3068impl<T> core::ops::Mul<InverseDoseEquivalent<T>> for &Distance<T> where T: NumLike {
3070 type Output = InverseAcceleration<T>;
3071 fn mul(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
3072 InverseAcceleration{s2pm: self.m.clone() * rhs.per_Sv}
3073 }
3074}
3075impl<T> core::ops::Mul<&InverseDoseEquivalent<T>> for Distance<T> where T: NumLike {
3077 type Output = InverseAcceleration<T>;
3078 fn mul(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
3079 InverseAcceleration{s2pm: self.m * rhs.per_Sv.clone()}
3080 }
3081}
3082impl<T> core::ops::Mul<&InverseDoseEquivalent<T>> for &Distance<T> where T: NumLike {
3084 type Output = InverseAcceleration<T>;
3085 fn mul(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
3086 InverseAcceleration{s2pm: self.m.clone() * rhs.per_Sv.clone()}
3087 }
3088}
3089
3090impl<T> core::ops::Div<Distance<T>> for f64 where T: NumLike+From<f64> {
3093 type Output = InverseDistance<T>;
3094 fn div(self, rhs: Distance<T>) -> Self::Output {
3095 InverseDistance{per_m: T::from(self) / rhs.m}
3096 }
3097}
3098impl<T> core::ops::Div<Distance<T>> for &f64 where T: NumLike+From<f64> {
3100 type Output = InverseDistance<T>;
3101 fn div(self, rhs: Distance<T>) -> Self::Output {
3102 InverseDistance{per_m: T::from(self.clone()) / rhs.m}
3103 }
3104}
3105impl<T> core::ops::Div<&Distance<T>> for f64 where T: NumLike+From<f64> {
3107 type Output = InverseDistance<T>;
3108 fn div(self, rhs: &Distance<T>) -> Self::Output {
3109 InverseDistance{per_m: T::from(self) / rhs.m.clone()}
3110 }
3111}
3112impl<T> core::ops::Div<&Distance<T>> for &f64 where T: NumLike+From<f64> {
3114 type Output = InverseDistance<T>;
3115 fn div(self, rhs: &Distance<T>) -> Self::Output {
3116 InverseDistance{per_m: T::from(self.clone()) / rhs.m.clone()}
3117 }
3118}
3119
3120impl<T> core::ops::Div<Distance<T>> for f32 where T: NumLike+From<f32> {
3123 type Output = InverseDistance<T>;
3124 fn div(self, rhs: Distance<T>) -> Self::Output {
3125 InverseDistance{per_m: T::from(self) / rhs.m}
3126 }
3127}
3128impl<T> core::ops::Div<Distance<T>> for &f32 where T: NumLike+From<f32> {
3130 type Output = InverseDistance<T>;
3131 fn div(self, rhs: Distance<T>) -> Self::Output {
3132 InverseDistance{per_m: T::from(self.clone()) / rhs.m}
3133 }
3134}
3135impl<T> core::ops::Div<&Distance<T>> for f32 where T: NumLike+From<f32> {
3137 type Output = InverseDistance<T>;
3138 fn div(self, rhs: &Distance<T>) -> Self::Output {
3139 InverseDistance{per_m: T::from(self) / rhs.m.clone()}
3140 }
3141}
3142impl<T> core::ops::Div<&Distance<T>> for &f32 where T: NumLike+From<f32> {
3144 type Output = InverseDistance<T>;
3145 fn div(self, rhs: &Distance<T>) -> Self::Output {
3146 InverseDistance{per_m: T::from(self.clone()) / rhs.m.clone()}
3147 }
3148}
3149
3150impl<T> core::ops::Div<Distance<T>> for i64 where T: NumLike+From<i64> {
3153 type Output = InverseDistance<T>;
3154 fn div(self, rhs: Distance<T>) -> Self::Output {
3155 InverseDistance{per_m: T::from(self) / rhs.m}
3156 }
3157}
3158impl<T> core::ops::Div<Distance<T>> for &i64 where T: NumLike+From<i64> {
3160 type Output = InverseDistance<T>;
3161 fn div(self, rhs: Distance<T>) -> Self::Output {
3162 InverseDistance{per_m: T::from(self.clone()) / rhs.m}
3163 }
3164}
3165impl<T> core::ops::Div<&Distance<T>> for i64 where T: NumLike+From<i64> {
3167 type Output = InverseDistance<T>;
3168 fn div(self, rhs: &Distance<T>) -> Self::Output {
3169 InverseDistance{per_m: T::from(self) / rhs.m.clone()}
3170 }
3171}
3172impl<T> core::ops::Div<&Distance<T>> for &i64 where T: NumLike+From<i64> {
3174 type Output = InverseDistance<T>;
3175 fn div(self, rhs: &Distance<T>) -> Self::Output {
3176 InverseDistance{per_m: T::from(self.clone()) / rhs.m.clone()}
3177 }
3178}
3179
3180impl<T> core::ops::Div<Distance<T>> for i32 where T: NumLike+From<i32> {
3183 type Output = InverseDistance<T>;
3184 fn div(self, rhs: Distance<T>) -> Self::Output {
3185 InverseDistance{per_m: T::from(self) / rhs.m}
3186 }
3187}
3188impl<T> core::ops::Div<Distance<T>> for &i32 where T: NumLike+From<i32> {
3190 type Output = InverseDistance<T>;
3191 fn div(self, rhs: Distance<T>) -> Self::Output {
3192 InverseDistance{per_m: T::from(self.clone()) / rhs.m}
3193 }
3194}
3195impl<T> core::ops::Div<&Distance<T>> for i32 where T: NumLike+From<i32> {
3197 type Output = InverseDistance<T>;
3198 fn div(self, rhs: &Distance<T>) -> Self::Output {
3199 InverseDistance{per_m: T::from(self) / rhs.m.clone()}
3200 }
3201}
3202impl<T> core::ops::Div<&Distance<T>> for &i32 where T: NumLike+From<i32> {
3204 type Output = InverseDistance<T>;
3205 fn div(self, rhs: &Distance<T>) -> Self::Output {
3206 InverseDistance{per_m: T::from(self.clone()) / rhs.m.clone()}
3207 }
3208}
3209
3210#[cfg(feature="num-bigfloat")]
3213impl<T> core::ops::Div<Distance<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3214 type Output = InverseDistance<T>;
3215 fn div(self, rhs: Distance<T>) -> Self::Output {
3216 InverseDistance{per_m: T::from(self) / rhs.m}
3217 }
3218}
3219#[cfg(feature="num-bigfloat")]
3221impl<T> core::ops::Div<Distance<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3222 type Output = InverseDistance<T>;
3223 fn div(self, rhs: Distance<T>) -> Self::Output {
3224 InverseDistance{per_m: T::from(self.clone()) / rhs.m}
3225 }
3226}
3227#[cfg(feature="num-bigfloat")]
3229impl<T> core::ops::Div<&Distance<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3230 type Output = InverseDistance<T>;
3231 fn div(self, rhs: &Distance<T>) -> Self::Output {
3232 InverseDistance{per_m: T::from(self) / rhs.m.clone()}
3233 }
3234}
3235#[cfg(feature="num-bigfloat")]
3237impl<T> core::ops::Div<&Distance<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
3238 type Output = InverseDistance<T>;
3239 fn div(self, rhs: &Distance<T>) -> Self::Output {
3240 InverseDistance{per_m: T::from(self.clone()) / rhs.m.clone()}
3241 }
3242}
3243
3244#[cfg(feature="num-complex")]
3247impl<T> core::ops::Div<Distance<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3248 type Output = InverseDistance<T>;
3249 fn div(self, rhs: Distance<T>) -> Self::Output {
3250 InverseDistance{per_m: T::from(self) / rhs.m}
3251 }
3252}
3253#[cfg(feature="num-complex")]
3255impl<T> core::ops::Div<Distance<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3256 type Output = InverseDistance<T>;
3257 fn div(self, rhs: Distance<T>) -> Self::Output {
3258 InverseDistance{per_m: T::from(self.clone()) / rhs.m}
3259 }
3260}
3261#[cfg(feature="num-complex")]
3263impl<T> core::ops::Div<&Distance<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3264 type Output = InverseDistance<T>;
3265 fn div(self, rhs: &Distance<T>) -> Self::Output {
3266 InverseDistance{per_m: T::from(self) / rhs.m.clone()}
3267 }
3268}
3269#[cfg(feature="num-complex")]
3271impl<T> core::ops::Div<&Distance<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
3272 type Output = InverseDistance<T>;
3273 fn div(self, rhs: &Distance<T>) -> Self::Output {
3274 InverseDistance{per_m: T::from(self.clone()) / rhs.m.clone()}
3275 }
3276}
3277
3278#[cfg(feature="num-complex")]
3281impl<T> core::ops::Div<Distance<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3282 type Output = InverseDistance<T>;
3283 fn div(self, rhs: Distance<T>) -> Self::Output {
3284 InverseDistance{per_m: T::from(self) / rhs.m}
3285 }
3286}
3287#[cfg(feature="num-complex")]
3289impl<T> core::ops::Div<Distance<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3290 type Output = InverseDistance<T>;
3291 fn div(self, rhs: Distance<T>) -> Self::Output {
3292 InverseDistance{per_m: T::from(self.clone()) / rhs.m}
3293 }
3294}
3295#[cfg(feature="num-complex")]
3297impl<T> core::ops::Div<&Distance<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3298 type Output = InverseDistance<T>;
3299 fn div(self, rhs: &Distance<T>) -> Self::Output {
3300 InverseDistance{per_m: T::from(self) / rhs.m.clone()}
3301 }
3302}
3303#[cfg(feature="num-complex")]
3305impl<T> core::ops::Div<&Distance<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
3306 type Output = InverseDistance<T>;
3307 fn div(self, rhs: &Distance<T>) -> Self::Output {
3308 InverseDistance{per_m: T::from(self.clone()) / rhs.m.clone()}
3309 }
3310}
3311
3312#[derive(UnitStruct, Debug, Clone)]
3314#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
3315pub struct InverseAmount<T: NumLike>{
3316 pub per_mol: T
3318}
3319
3320impl<T> InverseAmount<T> where T: NumLike {
3321
3322 pub fn unit_name() -> &'static str { "inverse moles" }
3324
3325 pub fn unit_symbol() -> &'static str { "1/mol" }
3327
3328 pub fn from_per_mole(per_mole: T) -> Self { InverseAmount{per_mol: per_mole} }
3333
3334 pub fn to_per_mole(&self) -> T { self.per_mol.clone() }
3336
3337 pub fn from_per_mol(per_mol: T) -> Self { InverseAmount{per_mol: per_mol} }
3342
3343 pub fn to_per_mol(&self) -> T { self.per_mol.clone() }
3345
3346}
3347
3348impl<T> fmt::Display for InverseAmount<T> where T: NumLike {
3349 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3350 write!(f, "{} {}", &self.per_mol, Self::unit_symbol())
3351 }
3352}
3353
3354impl<T> InverseAmount<T> where T: NumLike+From<f64> {
3355
3356 pub fn to_per_count(&self) -> T {
3360 return self.per_mol.clone() * T::from(1.66e-24_f64);
3361 }
3362
3363 pub fn from_per_count(per_count: T) -> Self {
3370 InverseAmount{per_mol: per_count * T::from(6.02e+23_f64)}
3371 }
3372
3373 pub fn to_per_mmol(&self) -> T {
3377 return self.per_mol.clone() * T::from(0.001_f64);
3378 }
3379
3380 pub fn from_per_mmol(per_mmol: T) -> Self {
3387 InverseAmount{per_mol: per_mmol * T::from(1000.0_f64)}
3388 }
3389
3390 pub fn to_per_umol(&self) -> T {
3394 return self.per_mol.clone() * T::from(1e-06_f64);
3395 }
3396
3397 pub fn from_per_umol(per_umol: T) -> Self {
3404 InverseAmount{per_mol: per_umol * T::from(1000000.0_f64)}
3405 }
3406
3407 pub fn to_per_nmol(&self) -> T {
3411 return self.per_mol.clone() * T::from(1e-09_f64);
3412 }
3413
3414 pub fn from_per_nmol(per_nmol: T) -> Self {
3421 InverseAmount{per_mol: per_nmol * T::from(1000000000.0_f64)}
3422 }
3423
3424 pub fn to_per_pmol(&self) -> T {
3428 return self.per_mol.clone() * T::from(1e-12_f64);
3429 }
3430
3431 pub fn from_per_pmol(per_pmol: T) -> Self {
3438 InverseAmount{per_mol: per_pmol * T::from(1000000000000.0_f64)}
3439 }
3440
3441}
3442
3443
3444#[cfg(feature="num-bigfloat")]
3446impl core::ops::Mul<InverseAmount<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
3447 type Output = InverseAmount<num_bigfloat::BigFloat>;
3448 fn mul(self, rhs: InverseAmount<num_bigfloat::BigFloat>) -> Self::Output {
3449 InverseAmount{per_mol: self * rhs.per_mol}
3450 }
3451}
3452#[cfg(feature="num-bigfloat")]
3454impl core::ops::Mul<InverseAmount<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
3455 type Output = InverseAmount<num_bigfloat::BigFloat>;
3456 fn mul(self, rhs: InverseAmount<num_bigfloat::BigFloat>) -> Self::Output {
3457 InverseAmount{per_mol: self.clone() * rhs.per_mol}
3458 }
3459}
3460#[cfg(feature="num-bigfloat")]
3462impl core::ops::Mul<&InverseAmount<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
3463 type Output = InverseAmount<num_bigfloat::BigFloat>;
3464 fn mul(self, rhs: &InverseAmount<num_bigfloat::BigFloat>) -> Self::Output {
3465 InverseAmount{per_mol: self * rhs.per_mol.clone()}
3466 }
3467}
3468#[cfg(feature="num-bigfloat")]
3470impl core::ops::Mul<&InverseAmount<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
3471 type Output = InverseAmount<num_bigfloat::BigFloat>;
3472 fn mul(self, rhs: &InverseAmount<num_bigfloat::BigFloat>) -> Self::Output {
3473 InverseAmount{per_mol: self.clone() * rhs.per_mol.clone()}
3474 }
3475}
3476
3477#[cfg(feature="num-complex")]
3479impl core::ops::Mul<InverseAmount<num_complex::Complex32>> for num_complex::Complex32 {
3480 type Output = InverseAmount<num_complex::Complex32>;
3481 fn mul(self, rhs: InverseAmount<num_complex::Complex32>) -> Self::Output {
3482 InverseAmount{per_mol: self * rhs.per_mol}
3483 }
3484}
3485#[cfg(feature="num-complex")]
3487impl core::ops::Mul<InverseAmount<num_complex::Complex32>> for &num_complex::Complex32 {
3488 type Output = InverseAmount<num_complex::Complex32>;
3489 fn mul(self, rhs: InverseAmount<num_complex::Complex32>) -> Self::Output {
3490 InverseAmount{per_mol: self.clone() * rhs.per_mol}
3491 }
3492}
3493#[cfg(feature="num-complex")]
3495impl core::ops::Mul<&InverseAmount<num_complex::Complex32>> for num_complex::Complex32 {
3496 type Output = InverseAmount<num_complex::Complex32>;
3497 fn mul(self, rhs: &InverseAmount<num_complex::Complex32>) -> Self::Output {
3498 InverseAmount{per_mol: self * rhs.per_mol.clone()}
3499 }
3500}
3501#[cfg(feature="num-complex")]
3503impl core::ops::Mul<&InverseAmount<num_complex::Complex32>> for &num_complex::Complex32 {
3504 type Output = InverseAmount<num_complex::Complex32>;
3505 fn mul(self, rhs: &InverseAmount<num_complex::Complex32>) -> Self::Output {
3506 InverseAmount{per_mol: self.clone() * rhs.per_mol.clone()}
3507 }
3508}
3509
3510#[cfg(feature="num-complex")]
3512impl core::ops::Mul<InverseAmount<num_complex::Complex64>> for num_complex::Complex64 {
3513 type Output = InverseAmount<num_complex::Complex64>;
3514 fn mul(self, rhs: InverseAmount<num_complex::Complex64>) -> Self::Output {
3515 InverseAmount{per_mol: self * rhs.per_mol}
3516 }
3517}
3518#[cfg(feature="num-complex")]
3520impl core::ops::Mul<InverseAmount<num_complex::Complex64>> for &num_complex::Complex64 {
3521 type Output = InverseAmount<num_complex::Complex64>;
3522 fn mul(self, rhs: InverseAmount<num_complex::Complex64>) -> Self::Output {
3523 InverseAmount{per_mol: self.clone() * rhs.per_mol}
3524 }
3525}
3526#[cfg(feature="num-complex")]
3528impl core::ops::Mul<&InverseAmount<num_complex::Complex64>> for num_complex::Complex64 {
3529 type Output = InverseAmount<num_complex::Complex64>;
3530 fn mul(self, rhs: &InverseAmount<num_complex::Complex64>) -> Self::Output {
3531 InverseAmount{per_mol: self * rhs.per_mol.clone()}
3532 }
3533}
3534#[cfg(feature="num-complex")]
3536impl core::ops::Mul<&InverseAmount<num_complex::Complex64>> for &num_complex::Complex64 {
3537 type Output = InverseAmount<num_complex::Complex64>;
3538 fn mul(self, rhs: &InverseAmount<num_complex::Complex64>) -> Self::Output {
3539 InverseAmount{per_mol: self.clone() * rhs.per_mol.clone()}
3540 }
3541}
3542
3543
3544
3545
3546impl<T> core::ops::Div<InverseMass<T>> for InverseAmount<T> where T: NumLike {
3549 type Output = MolarMass<T>;
3550 fn div(self, rhs: InverseMass<T>) -> Self::Output {
3551 MolarMass{kgpmol: self.per_mol / rhs.per_kg}
3552 }
3553}
3554impl<T> core::ops::Div<InverseMass<T>> for &InverseAmount<T> where T: NumLike {
3556 type Output = MolarMass<T>;
3557 fn div(self, rhs: InverseMass<T>) -> Self::Output {
3558 MolarMass{kgpmol: self.per_mol.clone() / rhs.per_kg}
3559 }
3560}
3561impl<T> core::ops::Div<&InverseMass<T>> for InverseAmount<T> where T: NumLike {
3563 type Output = MolarMass<T>;
3564 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
3565 MolarMass{kgpmol: self.per_mol / rhs.per_kg.clone()}
3566 }
3567}
3568impl<T> core::ops::Div<&InverseMass<T>> for &InverseAmount<T> where T: NumLike {
3570 type Output = MolarMass<T>;
3571 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
3572 MolarMass{kgpmol: self.per_mol.clone() / rhs.per_kg.clone()}
3573 }
3574}
3575
3576impl<T> core::ops::Mul<Mass<T>> for InverseAmount<T> where T: NumLike {
3579 type Output = MolarMass<T>;
3580 fn mul(self, rhs: Mass<T>) -> Self::Output {
3581 MolarMass{kgpmol: self.per_mol * rhs.kg}
3582 }
3583}
3584impl<T> core::ops::Mul<Mass<T>> for &InverseAmount<T> where T: NumLike {
3586 type Output = MolarMass<T>;
3587 fn mul(self, rhs: Mass<T>) -> Self::Output {
3588 MolarMass{kgpmol: self.per_mol.clone() * rhs.kg}
3589 }
3590}
3591impl<T> core::ops::Mul<&Mass<T>> for InverseAmount<T> where T: NumLike {
3593 type Output = MolarMass<T>;
3594 fn mul(self, rhs: &Mass<T>) -> Self::Output {
3595 MolarMass{kgpmol: self.per_mol * rhs.kg.clone()}
3596 }
3597}
3598impl<T> core::ops::Mul<&Mass<T>> for &InverseAmount<T> where T: NumLike {
3600 type Output = MolarMass<T>;
3601 fn mul(self, rhs: &Mass<T>) -> Self::Output {
3602 MolarMass{kgpmol: self.per_mol.clone() * rhs.kg.clone()}
3603 }
3604}
3605
3606impl<T> core::ops::Mul<Time<T>> for InverseAmount<T> where T: NumLike {
3609 type Output = InverseCatalyticActivity<T>;
3610 fn mul(self, rhs: Time<T>) -> Self::Output {
3611 InverseCatalyticActivity{s_per_mol: self.per_mol * rhs.s}
3612 }
3613}
3614impl<T> core::ops::Mul<Time<T>> for &InverseAmount<T> where T: NumLike {
3616 type Output = InverseCatalyticActivity<T>;
3617 fn mul(self, rhs: Time<T>) -> Self::Output {
3618 InverseCatalyticActivity{s_per_mol: self.per_mol.clone() * rhs.s}
3619 }
3620}
3621impl<T> core::ops::Mul<&Time<T>> for InverseAmount<T> where T: NumLike {
3623 type Output = InverseCatalyticActivity<T>;
3624 fn mul(self, rhs: &Time<T>) -> Self::Output {
3625 InverseCatalyticActivity{s_per_mol: self.per_mol * rhs.s.clone()}
3626 }
3627}
3628impl<T> core::ops::Mul<&Time<T>> for &InverseAmount<T> where T: NumLike {
3630 type Output = InverseCatalyticActivity<T>;
3631 fn mul(self, rhs: &Time<T>) -> Self::Output {
3632 InverseCatalyticActivity{s_per_mol: self.per_mol.clone() * rhs.s.clone()}
3633 }
3634}
3635
3636impl<T> core::ops::Mul<CatalyticActivity<T>> for InverseAmount<T> where T: NumLike {
3639 type Output = Frequency<T>;
3640 fn mul(self, rhs: CatalyticActivity<T>) -> Self::Output {
3641 Frequency{Hz: self.per_mol * rhs.molps}
3642 }
3643}
3644impl<T> core::ops::Mul<CatalyticActivity<T>> for &InverseAmount<T> where T: NumLike {
3646 type Output = Frequency<T>;
3647 fn mul(self, rhs: CatalyticActivity<T>) -> Self::Output {
3648 Frequency{Hz: self.per_mol.clone() * rhs.molps}
3649 }
3650}
3651impl<T> core::ops::Mul<&CatalyticActivity<T>> for InverseAmount<T> where T: NumLike {
3653 type Output = Frequency<T>;
3654 fn mul(self, rhs: &CatalyticActivity<T>) -> Self::Output {
3655 Frequency{Hz: self.per_mol * rhs.molps.clone()}
3656 }
3657}
3658impl<T> core::ops::Mul<&CatalyticActivity<T>> for &InverseAmount<T> where T: NumLike {
3660 type Output = Frequency<T>;
3661 fn mul(self, rhs: &CatalyticActivity<T>) -> Self::Output {
3662 Frequency{Hz: self.per_mol.clone() * rhs.molps.clone()}
3663 }
3664}
3665
3666impl<T> core::ops::Mul<Concentration<T>> for InverseAmount<T> where T: NumLike {
3669 type Output = InverseVolume<T>;
3670 fn mul(self, rhs: Concentration<T>) -> Self::Output {
3671 InverseVolume{per_m3: self.per_mol * rhs.molpm3}
3672 }
3673}
3674impl<T> core::ops::Mul<Concentration<T>> for &InverseAmount<T> where T: NumLike {
3676 type Output = InverseVolume<T>;
3677 fn mul(self, rhs: Concentration<T>) -> Self::Output {
3678 InverseVolume{per_m3: self.per_mol.clone() * rhs.molpm3}
3679 }
3680}
3681impl<T> core::ops::Mul<&Concentration<T>> for InverseAmount<T> where T: NumLike {
3683 type Output = InverseVolume<T>;
3684 fn mul(self, rhs: &Concentration<T>) -> Self::Output {
3685 InverseVolume{per_m3: self.per_mol * rhs.molpm3.clone()}
3686 }
3687}
3688impl<T> core::ops::Mul<&Concentration<T>> for &InverseAmount<T> where T: NumLike {
3690 type Output = InverseVolume<T>;
3691 fn mul(self, rhs: &Concentration<T>) -> Self::Output {
3692 InverseVolume{per_m3: self.per_mol.clone() * rhs.molpm3.clone()}
3693 }
3694}
3695
3696impl<T> core::ops::Div<InverseCatalyticActivity<T>> for InverseAmount<T> where T: NumLike {
3699 type Output = Frequency<T>;
3700 fn div(self, rhs: InverseCatalyticActivity<T>) -> Self::Output {
3701 Frequency{Hz: self.per_mol / rhs.s_per_mol}
3702 }
3703}
3704impl<T> core::ops::Div<InverseCatalyticActivity<T>> for &InverseAmount<T> where T: NumLike {
3706 type Output = Frequency<T>;
3707 fn div(self, rhs: InverseCatalyticActivity<T>) -> Self::Output {
3708 Frequency{Hz: self.per_mol.clone() / rhs.s_per_mol}
3709 }
3710}
3711impl<T> core::ops::Div<&InverseCatalyticActivity<T>> for InverseAmount<T> where T: NumLike {
3713 type Output = Frequency<T>;
3714 fn div(self, rhs: &InverseCatalyticActivity<T>) -> Self::Output {
3715 Frequency{Hz: self.per_mol / rhs.s_per_mol.clone()}
3716 }
3717}
3718impl<T> core::ops::Div<&InverseCatalyticActivity<T>> for &InverseAmount<T> where T: NumLike {
3720 type Output = Frequency<T>;
3721 fn div(self, rhs: &InverseCatalyticActivity<T>) -> Self::Output {
3722 Frequency{Hz: self.per_mol.clone() / rhs.s_per_mol.clone()}
3723 }
3724}
3725
3726impl<T> core::ops::Mul<Molality<T>> for InverseAmount<T> where T: NumLike {
3729 type Output = InverseMass<T>;
3730 fn mul(self, rhs: Molality<T>) -> Self::Output {
3731 InverseMass{per_kg: self.per_mol * rhs.molpkg}
3732 }
3733}
3734impl<T> core::ops::Mul<Molality<T>> for &InverseAmount<T> where T: NumLike {
3736 type Output = InverseMass<T>;
3737 fn mul(self, rhs: Molality<T>) -> Self::Output {
3738 InverseMass{per_kg: self.per_mol.clone() * rhs.molpkg}
3739 }
3740}
3741impl<T> core::ops::Mul<&Molality<T>> for InverseAmount<T> where T: NumLike {
3743 type Output = InverseMass<T>;
3744 fn mul(self, rhs: &Molality<T>) -> Self::Output {
3745 InverseMass{per_kg: self.per_mol * rhs.molpkg.clone()}
3746 }
3747}
3748impl<T> core::ops::Mul<&Molality<T>> for &InverseAmount<T> where T: NumLike {
3750 type Output = InverseMass<T>;
3751 fn mul(self, rhs: &Molality<T>) -> Self::Output {
3752 InverseMass{per_kg: self.per_mol.clone() * rhs.molpkg.clone()}
3753 }
3754}
3755
3756impl<T> core::ops::Div<MolarMass<T>> for InverseAmount<T> where T: NumLike {
3759 type Output = InverseMass<T>;
3760 fn div(self, rhs: MolarMass<T>) -> Self::Output {
3761 InverseMass{per_kg: self.per_mol / rhs.kgpmol}
3762 }
3763}
3764impl<T> core::ops::Div<MolarMass<T>> for &InverseAmount<T> where T: NumLike {
3766 type Output = InverseMass<T>;
3767 fn div(self, rhs: MolarMass<T>) -> Self::Output {
3768 InverseMass{per_kg: self.per_mol.clone() / rhs.kgpmol}
3769 }
3770}
3771impl<T> core::ops::Div<&MolarMass<T>> for InverseAmount<T> where T: NumLike {
3773 type Output = InverseMass<T>;
3774 fn div(self, rhs: &MolarMass<T>) -> Self::Output {
3775 InverseMass{per_kg: self.per_mol / rhs.kgpmol.clone()}
3776 }
3777}
3778impl<T> core::ops::Div<&MolarMass<T>> for &InverseAmount<T> where T: NumLike {
3780 type Output = InverseMass<T>;
3781 fn div(self, rhs: &MolarMass<T>) -> Self::Output {
3782 InverseMass{per_kg: self.per_mol.clone() / rhs.kgpmol.clone()}
3783 }
3784}
3785
3786impl<T> core::ops::Div<MolarVolume<T>> for InverseAmount<T> where T: NumLike {
3789 type Output = InverseVolume<T>;
3790 fn div(self, rhs: MolarVolume<T>) -> Self::Output {
3791 InverseVolume{per_m3: self.per_mol / rhs.m3_per_mol}
3792 }
3793}
3794impl<T> core::ops::Div<MolarVolume<T>> for &InverseAmount<T> where T: NumLike {
3796 type Output = InverseVolume<T>;
3797 fn div(self, rhs: MolarVolume<T>) -> Self::Output {
3798 InverseVolume{per_m3: self.per_mol.clone() / rhs.m3_per_mol}
3799 }
3800}
3801impl<T> core::ops::Div<&MolarVolume<T>> for InverseAmount<T> where T: NumLike {
3803 type Output = InverseVolume<T>;
3804 fn div(self, rhs: &MolarVolume<T>) -> Self::Output {
3805 InverseVolume{per_m3: self.per_mol / rhs.m3_per_mol.clone()}
3806 }
3807}
3808impl<T> core::ops::Div<&MolarVolume<T>> for &InverseAmount<T> where T: NumLike {
3810 type Output = InverseVolume<T>;
3811 fn div(self, rhs: &MolarVolume<T>) -> Self::Output {
3812 InverseVolume{per_m3: self.per_mol.clone() / rhs.m3_per_mol.clone()}
3813 }
3814}
3815
3816impl<T> core::ops::Div<InverseVolume<T>> for InverseAmount<T> where T: NumLike {
3819 type Output = MolarVolume<T>;
3820 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
3821 MolarVolume{m3_per_mol: self.per_mol / rhs.per_m3}
3822 }
3823}
3824impl<T> core::ops::Div<InverseVolume<T>> for &InverseAmount<T> where T: NumLike {
3826 type Output = MolarVolume<T>;
3827 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
3828 MolarVolume{m3_per_mol: self.per_mol.clone() / rhs.per_m3}
3829 }
3830}
3831impl<T> core::ops::Div<&InverseVolume<T>> for InverseAmount<T> where T: NumLike {
3833 type Output = MolarVolume<T>;
3834 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
3835 MolarVolume{m3_per_mol: self.per_mol / rhs.per_m3.clone()}
3836 }
3837}
3838impl<T> core::ops::Div<&InverseVolume<T>> for &InverseAmount<T> where T: NumLike {
3840 type Output = MolarVolume<T>;
3841 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
3842 MolarVolume{m3_per_mol: self.per_mol.clone() / rhs.per_m3.clone()}
3843 }
3844}
3845
3846impl<T> core::ops::Mul<Volume<T>> for InverseAmount<T> where T: NumLike {
3849 type Output = MolarVolume<T>;
3850 fn mul(self, rhs: Volume<T>) -> Self::Output {
3851 MolarVolume{m3_per_mol: self.per_mol * rhs.m3}
3852 }
3853}
3854impl<T> core::ops::Mul<Volume<T>> for &InverseAmount<T> where T: NumLike {
3856 type Output = MolarVolume<T>;
3857 fn mul(self, rhs: Volume<T>) -> Self::Output {
3858 MolarVolume{m3_per_mol: self.per_mol.clone() * rhs.m3}
3859 }
3860}
3861impl<T> core::ops::Mul<&Volume<T>> for InverseAmount<T> where T: NumLike {
3863 type Output = MolarVolume<T>;
3864 fn mul(self, rhs: &Volume<T>) -> Self::Output {
3865 MolarVolume{m3_per_mol: self.per_mol * rhs.m3.clone()}
3866 }
3867}
3868impl<T> core::ops::Mul<&Volume<T>> for &InverseAmount<T> where T: NumLike {
3870 type Output = MolarVolume<T>;
3871 fn mul(self, rhs: &Volume<T>) -> Self::Output {
3872 MolarVolume{m3_per_mol: self.per_mol.clone() * rhs.m3.clone()}
3873 }
3874}
3875
3876impl<T> core::ops::Div<Frequency<T>> for InverseAmount<T> where T: NumLike {
3879 type Output = InverseCatalyticActivity<T>;
3880 fn div(self, rhs: Frequency<T>) -> Self::Output {
3881 InverseCatalyticActivity{s_per_mol: self.per_mol / rhs.Hz}
3882 }
3883}
3884impl<T> core::ops::Div<Frequency<T>> for &InverseAmount<T> where T: NumLike {
3886 type Output = InverseCatalyticActivity<T>;
3887 fn div(self, rhs: Frequency<T>) -> Self::Output {
3888 InverseCatalyticActivity{s_per_mol: self.per_mol.clone() / rhs.Hz}
3889 }
3890}
3891impl<T> core::ops::Div<&Frequency<T>> for InverseAmount<T> where T: NumLike {
3893 type Output = InverseCatalyticActivity<T>;
3894 fn div(self, rhs: &Frequency<T>) -> Self::Output {
3895 InverseCatalyticActivity{s_per_mol: self.per_mol / rhs.Hz.clone()}
3896 }
3897}
3898impl<T> core::ops::Div<&Frequency<T>> for &InverseAmount<T> where T: NumLike {
3900 type Output = InverseCatalyticActivity<T>;
3901 fn div(self, rhs: &Frequency<T>) -> Self::Output {
3902 InverseCatalyticActivity{s_per_mol: self.per_mol.clone() / rhs.Hz.clone()}
3903 }
3904}
3905
3906impl<T> core::ops::Div<InverseAmount<T>> for f64 where T: NumLike+From<f64> {
3909 type Output = Amount<T>;
3910 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
3911 Amount{mol: T::from(self) / rhs.per_mol}
3912 }
3913}
3914impl<T> core::ops::Div<InverseAmount<T>> for &f64 where T: NumLike+From<f64> {
3916 type Output = Amount<T>;
3917 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
3918 Amount{mol: T::from(self.clone()) / rhs.per_mol}
3919 }
3920}
3921impl<T> core::ops::Div<&InverseAmount<T>> for f64 where T: NumLike+From<f64> {
3923 type Output = Amount<T>;
3924 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
3925 Amount{mol: T::from(self) / rhs.per_mol.clone()}
3926 }
3927}
3928impl<T> core::ops::Div<&InverseAmount<T>> for &f64 where T: NumLike+From<f64> {
3930 type Output = Amount<T>;
3931 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
3932 Amount{mol: T::from(self.clone()) / rhs.per_mol.clone()}
3933 }
3934}
3935
3936impl<T> core::ops::Div<InverseAmount<T>> for f32 where T: NumLike+From<f32> {
3939 type Output = Amount<T>;
3940 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
3941 Amount{mol: T::from(self) / rhs.per_mol}
3942 }
3943}
3944impl<T> core::ops::Div<InverseAmount<T>> for &f32 where T: NumLike+From<f32> {
3946 type Output = Amount<T>;
3947 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
3948 Amount{mol: T::from(self.clone()) / rhs.per_mol}
3949 }
3950}
3951impl<T> core::ops::Div<&InverseAmount<T>> for f32 where T: NumLike+From<f32> {
3953 type Output = Amount<T>;
3954 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
3955 Amount{mol: T::from(self) / rhs.per_mol.clone()}
3956 }
3957}
3958impl<T> core::ops::Div<&InverseAmount<T>> for &f32 where T: NumLike+From<f32> {
3960 type Output = Amount<T>;
3961 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
3962 Amount{mol: T::from(self.clone()) / rhs.per_mol.clone()}
3963 }
3964}
3965
3966impl<T> core::ops::Div<InverseAmount<T>> for i64 where T: NumLike+From<i64> {
3969 type Output = Amount<T>;
3970 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
3971 Amount{mol: T::from(self) / rhs.per_mol}
3972 }
3973}
3974impl<T> core::ops::Div<InverseAmount<T>> for &i64 where T: NumLike+From<i64> {
3976 type Output = Amount<T>;
3977 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
3978 Amount{mol: T::from(self.clone()) / rhs.per_mol}
3979 }
3980}
3981impl<T> core::ops::Div<&InverseAmount<T>> for i64 where T: NumLike+From<i64> {
3983 type Output = Amount<T>;
3984 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
3985 Amount{mol: T::from(self) / rhs.per_mol.clone()}
3986 }
3987}
3988impl<T> core::ops::Div<&InverseAmount<T>> for &i64 where T: NumLike+From<i64> {
3990 type Output = Amount<T>;
3991 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
3992 Amount{mol: T::from(self.clone()) / rhs.per_mol.clone()}
3993 }
3994}
3995
3996impl<T> core::ops::Div<InverseAmount<T>> for i32 where T: NumLike+From<i32> {
3999 type Output = Amount<T>;
4000 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4001 Amount{mol: T::from(self) / rhs.per_mol}
4002 }
4003}
4004impl<T> core::ops::Div<InverseAmount<T>> for &i32 where T: NumLike+From<i32> {
4006 type Output = Amount<T>;
4007 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4008 Amount{mol: T::from(self.clone()) / rhs.per_mol}
4009 }
4010}
4011impl<T> core::ops::Div<&InverseAmount<T>> for i32 where T: NumLike+From<i32> {
4013 type Output = Amount<T>;
4014 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4015 Amount{mol: T::from(self) / rhs.per_mol.clone()}
4016 }
4017}
4018impl<T> core::ops::Div<&InverseAmount<T>> for &i32 where T: NumLike+From<i32> {
4020 type Output = Amount<T>;
4021 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4022 Amount{mol: T::from(self.clone()) / rhs.per_mol.clone()}
4023 }
4024}
4025
4026#[cfg(feature="num-bigfloat")]
4029impl<T> core::ops::Div<InverseAmount<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
4030 type Output = Amount<T>;
4031 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4032 Amount{mol: T::from(self) / rhs.per_mol}
4033 }
4034}
4035#[cfg(feature="num-bigfloat")]
4037impl<T> core::ops::Div<InverseAmount<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
4038 type Output = Amount<T>;
4039 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4040 Amount{mol: T::from(self.clone()) / rhs.per_mol}
4041 }
4042}
4043#[cfg(feature="num-bigfloat")]
4045impl<T> core::ops::Div<&InverseAmount<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
4046 type Output = Amount<T>;
4047 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4048 Amount{mol: T::from(self) / rhs.per_mol.clone()}
4049 }
4050}
4051#[cfg(feature="num-bigfloat")]
4053impl<T> core::ops::Div<&InverseAmount<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
4054 type Output = Amount<T>;
4055 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4056 Amount{mol: T::from(self.clone()) / rhs.per_mol.clone()}
4057 }
4058}
4059
4060#[cfg(feature="num-complex")]
4063impl<T> core::ops::Div<InverseAmount<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
4064 type Output = Amount<T>;
4065 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4066 Amount{mol: T::from(self) / rhs.per_mol}
4067 }
4068}
4069#[cfg(feature="num-complex")]
4071impl<T> core::ops::Div<InverseAmount<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
4072 type Output = Amount<T>;
4073 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4074 Amount{mol: T::from(self.clone()) / rhs.per_mol}
4075 }
4076}
4077#[cfg(feature="num-complex")]
4079impl<T> core::ops::Div<&InverseAmount<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
4080 type Output = Amount<T>;
4081 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4082 Amount{mol: T::from(self) / rhs.per_mol.clone()}
4083 }
4084}
4085#[cfg(feature="num-complex")]
4087impl<T> core::ops::Div<&InverseAmount<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
4088 type Output = Amount<T>;
4089 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4090 Amount{mol: T::from(self.clone()) / rhs.per_mol.clone()}
4091 }
4092}
4093
4094#[cfg(feature="num-complex")]
4097impl<T> core::ops::Div<InverseAmount<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
4098 type Output = Amount<T>;
4099 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4100 Amount{mol: T::from(self) / rhs.per_mol}
4101 }
4102}
4103#[cfg(feature="num-complex")]
4105impl<T> core::ops::Div<InverseAmount<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
4106 type Output = Amount<T>;
4107 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
4108 Amount{mol: T::from(self.clone()) / rhs.per_mol}
4109 }
4110}
4111#[cfg(feature="num-complex")]
4113impl<T> core::ops::Div<&InverseAmount<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
4114 type Output = Amount<T>;
4115 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4116 Amount{mol: T::from(self) / rhs.per_mol.clone()}
4117 }
4118}
4119#[cfg(feature="num-complex")]
4121impl<T> core::ops::Div<&InverseAmount<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
4122 type Output = Amount<T>;
4123 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
4124 Amount{mol: T::from(self.clone()) / rhs.per_mol.clone()}
4125 }
4126}
4127
4128#[derive(UnitStruct, Debug, Clone)]
4130#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
4131pub struct InverseCurrent<T: NumLike>{
4132 pub per_A: T
4134}
4135
4136impl<T> InverseCurrent<T> where T: NumLike {
4137
4138 pub fn unit_name() -> &'static str { "inverse amperes" }
4140
4141 pub fn unit_symbol() -> &'static str { "1/A" }
4143
4144 pub fn from_per_A(per_A: T) -> Self { InverseCurrent{per_A: per_A} }
4149
4150 pub fn to_per_A(&self) -> T { self.per_A.clone() }
4152
4153 pub fn from_per_ampere(per_ampere: T) -> Self { InverseCurrent{per_A: per_ampere} }
4158
4159 pub fn to_per_ampere(&self) -> T { self.per_A.clone() }
4161
4162}
4163
4164impl<T> fmt::Display for InverseCurrent<T> where T: NumLike {
4165 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4166 write!(f, "{} {}", &self.per_A, Self::unit_symbol())
4167 }
4168}
4169
4170impl<T> InverseCurrent<T> where T: NumLike+From<f64> {
4171
4172 pub fn to_per_mA(&self) -> T {
4176 return self.per_A.clone() * T::from(0.001_f64);
4177 }
4178
4179 pub fn from_per_mA(per_mA: T) -> Self {
4186 InverseCurrent{per_A: per_mA * T::from(1000.0_f64)}
4187 }
4188
4189 pub fn to_per_uA(&self) -> T {
4193 return self.per_A.clone() * T::from(1e-06_f64);
4194 }
4195
4196 pub fn from_per_uA(per_uA: T) -> Self {
4203 InverseCurrent{per_A: per_uA * T::from(1000000.0_f64)}
4204 }
4205
4206 pub fn to_per_nA(&self) -> T {
4210 return self.per_A.clone() * T::from(1e-09_f64);
4211 }
4212
4213 pub fn from_per_nA(per_nA: T) -> Self {
4220 InverseCurrent{per_A: per_nA * T::from(1000000000.0_f64)}
4221 }
4222
4223 pub fn to_per_kA(&self) -> T {
4227 return self.per_A.clone() * T::from(1000.0_f64);
4228 }
4229
4230 pub fn from_per_kA(per_kA: T) -> Self {
4237 InverseCurrent{per_A: per_kA * T::from(0.001_f64)}
4238 }
4239
4240 pub fn to_per_MA(&self) -> T {
4244 return self.per_A.clone() * T::from(1000000.0_f64);
4245 }
4246
4247 pub fn from_per_MA(per_MA: T) -> Self {
4254 InverseCurrent{per_A: per_MA * T::from(1e-06_f64)}
4255 }
4256
4257 pub fn to_per_GA(&self) -> T {
4261 return self.per_A.clone() * T::from(1000000000.0_f64);
4262 }
4263
4264 pub fn from_per_GA(per_GA: T) -> Self {
4271 InverseCurrent{per_A: per_GA * T::from(1e-09_f64)}
4272 }
4273
4274}
4275
4276
4277#[cfg(feature="num-bigfloat")]
4279impl core::ops::Mul<InverseCurrent<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
4280 type Output = InverseCurrent<num_bigfloat::BigFloat>;
4281 fn mul(self, rhs: InverseCurrent<num_bigfloat::BigFloat>) -> Self::Output {
4282 InverseCurrent{per_A: self * rhs.per_A}
4283 }
4284}
4285#[cfg(feature="num-bigfloat")]
4287impl core::ops::Mul<InverseCurrent<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
4288 type Output = InverseCurrent<num_bigfloat::BigFloat>;
4289 fn mul(self, rhs: InverseCurrent<num_bigfloat::BigFloat>) -> Self::Output {
4290 InverseCurrent{per_A: self.clone() * rhs.per_A}
4291 }
4292}
4293#[cfg(feature="num-bigfloat")]
4295impl core::ops::Mul<&InverseCurrent<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
4296 type Output = InverseCurrent<num_bigfloat::BigFloat>;
4297 fn mul(self, rhs: &InverseCurrent<num_bigfloat::BigFloat>) -> Self::Output {
4298 InverseCurrent{per_A: self * rhs.per_A.clone()}
4299 }
4300}
4301#[cfg(feature="num-bigfloat")]
4303impl core::ops::Mul<&InverseCurrent<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
4304 type Output = InverseCurrent<num_bigfloat::BigFloat>;
4305 fn mul(self, rhs: &InverseCurrent<num_bigfloat::BigFloat>) -> Self::Output {
4306 InverseCurrent{per_A: self.clone() * rhs.per_A.clone()}
4307 }
4308}
4309
4310#[cfg(feature="num-complex")]
4312impl core::ops::Mul<InverseCurrent<num_complex::Complex32>> for num_complex::Complex32 {
4313 type Output = InverseCurrent<num_complex::Complex32>;
4314 fn mul(self, rhs: InverseCurrent<num_complex::Complex32>) -> Self::Output {
4315 InverseCurrent{per_A: self * rhs.per_A}
4316 }
4317}
4318#[cfg(feature="num-complex")]
4320impl core::ops::Mul<InverseCurrent<num_complex::Complex32>> for &num_complex::Complex32 {
4321 type Output = InverseCurrent<num_complex::Complex32>;
4322 fn mul(self, rhs: InverseCurrent<num_complex::Complex32>) -> Self::Output {
4323 InverseCurrent{per_A: self.clone() * rhs.per_A}
4324 }
4325}
4326#[cfg(feature="num-complex")]
4328impl core::ops::Mul<&InverseCurrent<num_complex::Complex32>> for num_complex::Complex32 {
4329 type Output = InverseCurrent<num_complex::Complex32>;
4330 fn mul(self, rhs: &InverseCurrent<num_complex::Complex32>) -> Self::Output {
4331 InverseCurrent{per_A: self * rhs.per_A.clone()}
4332 }
4333}
4334#[cfg(feature="num-complex")]
4336impl core::ops::Mul<&InverseCurrent<num_complex::Complex32>> for &num_complex::Complex32 {
4337 type Output = InverseCurrent<num_complex::Complex32>;
4338 fn mul(self, rhs: &InverseCurrent<num_complex::Complex32>) -> Self::Output {
4339 InverseCurrent{per_A: self.clone() * rhs.per_A.clone()}
4340 }
4341}
4342
4343#[cfg(feature="num-complex")]
4345impl core::ops::Mul<InverseCurrent<num_complex::Complex64>> for num_complex::Complex64 {
4346 type Output = InverseCurrent<num_complex::Complex64>;
4347 fn mul(self, rhs: InverseCurrent<num_complex::Complex64>) -> Self::Output {
4348 InverseCurrent{per_A: self * rhs.per_A}
4349 }
4350}
4351#[cfg(feature="num-complex")]
4353impl core::ops::Mul<InverseCurrent<num_complex::Complex64>> for &num_complex::Complex64 {
4354 type Output = InverseCurrent<num_complex::Complex64>;
4355 fn mul(self, rhs: InverseCurrent<num_complex::Complex64>) -> Self::Output {
4356 InverseCurrent{per_A: self.clone() * rhs.per_A}
4357 }
4358}
4359#[cfg(feature="num-complex")]
4361impl core::ops::Mul<&InverseCurrent<num_complex::Complex64>> for num_complex::Complex64 {
4362 type Output = InverseCurrent<num_complex::Complex64>;
4363 fn mul(self, rhs: &InverseCurrent<num_complex::Complex64>) -> Self::Output {
4364 InverseCurrent{per_A: self * rhs.per_A.clone()}
4365 }
4366}
4367#[cfg(feature="num-complex")]
4369impl core::ops::Mul<&InverseCurrent<num_complex::Complex64>> for &num_complex::Complex64 {
4370 type Output = InverseCurrent<num_complex::Complex64>;
4371 fn mul(self, rhs: &InverseCurrent<num_complex::Complex64>) -> Self::Output {
4372 InverseCurrent{per_A: self.clone() * rhs.per_A.clone()}
4373 }
4374}
4375
4376
4377
4378
4379impl<T> core::ops::Div<Time<T>> for InverseCurrent<T> where T: NumLike {
4382 type Output = InverseCharge<T>;
4383 fn div(self, rhs: Time<T>) -> Self::Output {
4384 InverseCharge{per_C: self.per_A / rhs.s}
4385 }
4386}
4387impl<T> core::ops::Div<Time<T>> for &InverseCurrent<T> where T: NumLike {
4389 type Output = InverseCharge<T>;
4390 fn div(self, rhs: Time<T>) -> Self::Output {
4391 InverseCharge{per_C: self.per_A.clone() / rhs.s}
4392 }
4393}
4394impl<T> core::ops::Div<&Time<T>> for InverseCurrent<T> where T: NumLike {
4396 type Output = InverseCharge<T>;
4397 fn div(self, rhs: &Time<T>) -> Self::Output {
4398 InverseCharge{per_C: self.per_A / rhs.s.clone()}
4399 }
4400}
4401impl<T> core::ops::Div<&Time<T>> for &InverseCurrent<T> where T: NumLike {
4403 type Output = InverseCharge<T>;
4404 fn div(self, rhs: &Time<T>) -> Self::Output {
4405 InverseCharge{per_C: self.per_A.clone() / rhs.s.clone()}
4406 }
4407}
4408
4409impl<T> core::ops::Mul<Charge<T>> for InverseCurrent<T> where T: NumLike {
4412 type Output = Time<T>;
4413 fn mul(self, rhs: Charge<T>) -> Self::Output {
4414 Time{s: self.per_A * rhs.C}
4415 }
4416}
4417impl<T> core::ops::Mul<Charge<T>> for &InverseCurrent<T> where T: NumLike {
4419 type Output = Time<T>;
4420 fn mul(self, rhs: Charge<T>) -> Self::Output {
4421 Time{s: self.per_A.clone() * rhs.C}
4422 }
4423}
4424impl<T> core::ops::Mul<&Charge<T>> for InverseCurrent<T> where T: NumLike {
4426 type Output = Time<T>;
4427 fn mul(self, rhs: &Charge<T>) -> Self::Output {
4428 Time{s: self.per_A * rhs.C.clone()}
4429 }
4430}
4431impl<T> core::ops::Mul<&Charge<T>> for &InverseCurrent<T> where T: NumLike {
4433 type Output = Time<T>;
4434 fn mul(self, rhs: &Charge<T>) -> Self::Output {
4435 Time{s: self.per_A.clone() * rhs.C.clone()}
4436 }
4437}
4438
4439impl<T> core::ops::Mul<Conductance<T>> for InverseCurrent<T> where T: NumLike {
4442 type Output = InverseVoltage<T>;
4443 fn mul(self, rhs: Conductance<T>) -> Self::Output {
4444 InverseVoltage{per_V: self.per_A * rhs.S}
4445 }
4446}
4447impl<T> core::ops::Mul<Conductance<T>> for &InverseCurrent<T> where T: NumLike {
4449 type Output = InverseVoltage<T>;
4450 fn mul(self, rhs: Conductance<T>) -> Self::Output {
4451 InverseVoltage{per_V: self.per_A.clone() * rhs.S}
4452 }
4453}
4454impl<T> core::ops::Mul<&Conductance<T>> for InverseCurrent<T> where T: NumLike {
4456 type Output = InverseVoltage<T>;
4457 fn mul(self, rhs: &Conductance<T>) -> Self::Output {
4458 InverseVoltage{per_V: self.per_A * rhs.S.clone()}
4459 }
4460}
4461impl<T> core::ops::Mul<&Conductance<T>> for &InverseCurrent<T> where T: NumLike {
4463 type Output = InverseVoltage<T>;
4464 fn mul(self, rhs: &Conductance<T>) -> Self::Output {
4465 InverseVoltage{per_V: self.per_A.clone() * rhs.S.clone()}
4466 }
4467}
4468
4469impl<T> core::ops::Div<Inductance<T>> for InverseCurrent<T> where T: NumLike {
4472 type Output = InverseMagneticFlux<T>;
4473 fn div(self, rhs: Inductance<T>) -> Self::Output {
4474 InverseMagneticFlux{per_Wb: self.per_A / rhs.H}
4475 }
4476}
4477impl<T> core::ops::Div<Inductance<T>> for &InverseCurrent<T> where T: NumLike {
4479 type Output = InverseMagneticFlux<T>;
4480 fn div(self, rhs: Inductance<T>) -> Self::Output {
4481 InverseMagneticFlux{per_Wb: self.per_A.clone() / rhs.H}
4482 }
4483}
4484impl<T> core::ops::Div<&Inductance<T>> for InverseCurrent<T> where T: NumLike {
4486 type Output = InverseMagneticFlux<T>;
4487 fn div(self, rhs: &Inductance<T>) -> Self::Output {
4488 InverseMagneticFlux{per_Wb: self.per_A / rhs.H.clone()}
4489 }
4490}
4491impl<T> core::ops::Div<&Inductance<T>> for &InverseCurrent<T> where T: NumLike {
4493 type Output = InverseMagneticFlux<T>;
4494 fn div(self, rhs: &Inductance<T>) -> Self::Output {
4495 InverseMagneticFlux{per_Wb: self.per_A.clone() / rhs.H.clone()}
4496 }
4497}
4498
4499impl<T> core::ops::Div<InverseCharge<T>> for InverseCurrent<T> where T: NumLike {
4502 type Output = Time<T>;
4503 fn div(self, rhs: InverseCharge<T>) -> Self::Output {
4504 Time{s: self.per_A / rhs.per_C}
4505 }
4506}
4507impl<T> core::ops::Div<InverseCharge<T>> for &InverseCurrent<T> where T: NumLike {
4509 type Output = Time<T>;
4510 fn div(self, rhs: InverseCharge<T>) -> Self::Output {
4511 Time{s: self.per_A.clone() / rhs.per_C}
4512 }
4513}
4514impl<T> core::ops::Div<&InverseCharge<T>> for InverseCurrent<T> where T: NumLike {
4516 type Output = Time<T>;
4517 fn div(self, rhs: &InverseCharge<T>) -> Self::Output {
4518 Time{s: self.per_A / rhs.per_C.clone()}
4519 }
4520}
4521impl<T> core::ops::Div<&InverseCharge<T>> for &InverseCurrent<T> where T: NumLike {
4523 type Output = Time<T>;
4524 fn div(self, rhs: &InverseCharge<T>) -> Self::Output {
4525 Time{s: self.per_A.clone() / rhs.per_C.clone()}
4526 }
4527}
4528
4529impl<T> core::ops::Mul<InverseInductance<T>> for InverseCurrent<T> where T: NumLike {
4532 type Output = InverseMagneticFlux<T>;
4533 fn mul(self, rhs: InverseInductance<T>) -> Self::Output {
4534 InverseMagneticFlux{per_Wb: self.per_A * rhs.per_H}
4535 }
4536}
4537impl<T> core::ops::Mul<InverseInductance<T>> for &InverseCurrent<T> where T: NumLike {
4539 type Output = InverseMagneticFlux<T>;
4540 fn mul(self, rhs: InverseInductance<T>) -> Self::Output {
4541 InverseMagneticFlux{per_Wb: self.per_A.clone() * rhs.per_H}
4542 }
4543}
4544impl<T> core::ops::Mul<&InverseInductance<T>> for InverseCurrent<T> where T: NumLike {
4546 type Output = InverseMagneticFlux<T>;
4547 fn mul(self, rhs: &InverseInductance<T>) -> Self::Output {
4548 InverseMagneticFlux{per_Wb: self.per_A * rhs.per_H.clone()}
4549 }
4550}
4551impl<T> core::ops::Mul<&InverseInductance<T>> for &InverseCurrent<T> where T: NumLike {
4553 type Output = InverseMagneticFlux<T>;
4554 fn mul(self, rhs: &InverseInductance<T>) -> Self::Output {
4555 InverseMagneticFlux{per_Wb: self.per_A.clone() * rhs.per_H.clone()}
4556 }
4557}
4558
4559impl<T> core::ops::Mul<InverseMagneticFlux<T>> for InverseCurrent<T> where T: NumLike {
4562 type Output = InverseEnergy<T>;
4563 fn mul(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
4564 InverseEnergy{per_J: self.per_A * rhs.per_Wb}
4565 }
4566}
4567impl<T> core::ops::Mul<InverseMagneticFlux<T>> for &InverseCurrent<T> where T: NumLike {
4569 type Output = InverseEnergy<T>;
4570 fn mul(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
4571 InverseEnergy{per_J: self.per_A.clone() * rhs.per_Wb}
4572 }
4573}
4574impl<T> core::ops::Mul<&InverseMagneticFlux<T>> for InverseCurrent<T> where T: NumLike {
4576 type Output = InverseEnergy<T>;
4577 fn mul(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
4578 InverseEnergy{per_J: self.per_A * rhs.per_Wb.clone()}
4579 }
4580}
4581impl<T> core::ops::Mul<&InverseMagneticFlux<T>> for &InverseCurrent<T> where T: NumLike {
4583 type Output = InverseEnergy<T>;
4584 fn mul(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
4585 InverseEnergy{per_J: self.per_A.clone() * rhs.per_Wb.clone()}
4586 }
4587}
4588
4589impl<T> core::ops::Div<InverseMagneticFlux<T>> for InverseCurrent<T> where T: NumLike {
4592 type Output = Inductance<T>;
4593 fn div(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
4594 Inductance{H: self.per_A / rhs.per_Wb}
4595 }
4596}
4597impl<T> core::ops::Div<InverseMagneticFlux<T>> for &InverseCurrent<T> where T: NumLike {
4599 type Output = Inductance<T>;
4600 fn div(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
4601 Inductance{H: self.per_A.clone() / rhs.per_Wb}
4602 }
4603}
4604impl<T> core::ops::Div<&InverseMagneticFlux<T>> for InverseCurrent<T> where T: NumLike {
4606 type Output = Inductance<T>;
4607 fn div(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
4608 Inductance{H: self.per_A / rhs.per_Wb.clone()}
4609 }
4610}
4611impl<T> core::ops::Div<&InverseMagneticFlux<T>> for &InverseCurrent<T> where T: NumLike {
4613 type Output = Inductance<T>;
4614 fn div(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
4615 Inductance{H: self.per_A.clone() / rhs.per_Wb.clone()}
4616 }
4617}
4618
4619impl<T> core::ops::Mul<InverseVoltage<T>> for InverseCurrent<T> where T: NumLike {
4622 type Output = InversePower<T>;
4623 fn mul(self, rhs: InverseVoltage<T>) -> Self::Output {
4624 InversePower{per_W: self.per_A * rhs.per_V}
4625 }
4626}
4627impl<T> core::ops::Mul<InverseVoltage<T>> for &InverseCurrent<T> where T: NumLike {
4629 type Output = InversePower<T>;
4630 fn mul(self, rhs: InverseVoltage<T>) -> Self::Output {
4631 InversePower{per_W: self.per_A.clone() * rhs.per_V}
4632 }
4633}
4634impl<T> core::ops::Mul<&InverseVoltage<T>> for InverseCurrent<T> where T: NumLike {
4636 type Output = InversePower<T>;
4637 fn mul(self, rhs: &InverseVoltage<T>) -> Self::Output {
4638 InversePower{per_W: self.per_A * rhs.per_V.clone()}
4639 }
4640}
4641impl<T> core::ops::Mul<&InverseVoltage<T>> for &InverseCurrent<T> where T: NumLike {
4643 type Output = InversePower<T>;
4644 fn mul(self, rhs: &InverseVoltage<T>) -> Self::Output {
4645 InversePower{per_W: self.per_A.clone() * rhs.per_V.clone()}
4646 }
4647}
4648
4649impl<T> core::ops::Div<InverseVoltage<T>> for InverseCurrent<T> where T: NumLike {
4652 type Output = Resistance<T>;
4653 fn div(self, rhs: InverseVoltage<T>) -> Self::Output {
4654 Resistance{Ohm: self.per_A / rhs.per_V}
4655 }
4656}
4657impl<T> core::ops::Div<InverseVoltage<T>> for &InverseCurrent<T> where T: NumLike {
4659 type Output = Resistance<T>;
4660 fn div(self, rhs: InverseVoltage<T>) -> Self::Output {
4661 Resistance{Ohm: self.per_A.clone() / rhs.per_V}
4662 }
4663}
4664impl<T> core::ops::Div<&InverseVoltage<T>> for InverseCurrent<T> where T: NumLike {
4666 type Output = Resistance<T>;
4667 fn div(self, rhs: &InverseVoltage<T>) -> Self::Output {
4668 Resistance{Ohm: self.per_A / rhs.per_V.clone()}
4669 }
4670}
4671impl<T> core::ops::Div<&InverseVoltage<T>> for &InverseCurrent<T> where T: NumLike {
4673 type Output = Resistance<T>;
4674 fn div(self, rhs: &InverseVoltage<T>) -> Self::Output {
4675 Resistance{Ohm: self.per_A.clone() / rhs.per_V.clone()}
4676 }
4677}
4678
4679impl<T> core::ops::Mul<MagneticFlux<T>> for InverseCurrent<T> where T: NumLike {
4682 type Output = Inductance<T>;
4683 fn mul(self, rhs: MagneticFlux<T>) -> Self::Output {
4684 Inductance{H: self.per_A * rhs.Wb}
4685 }
4686}
4687impl<T> core::ops::Mul<MagneticFlux<T>> for &InverseCurrent<T> where T: NumLike {
4689 type Output = Inductance<T>;
4690 fn mul(self, rhs: MagneticFlux<T>) -> Self::Output {
4691 Inductance{H: self.per_A.clone() * rhs.Wb}
4692 }
4693}
4694impl<T> core::ops::Mul<&MagneticFlux<T>> for InverseCurrent<T> where T: NumLike {
4696 type Output = Inductance<T>;
4697 fn mul(self, rhs: &MagneticFlux<T>) -> Self::Output {
4698 Inductance{H: self.per_A * rhs.Wb.clone()}
4699 }
4700}
4701impl<T> core::ops::Mul<&MagneticFlux<T>> for &InverseCurrent<T> where T: NumLike {
4703 type Output = Inductance<T>;
4704 fn mul(self, rhs: &MagneticFlux<T>) -> Self::Output {
4705 Inductance{H: self.per_A.clone() * rhs.Wb.clone()}
4706 }
4707}
4708
4709impl<T> core::ops::Div<MagneticFlux<T>> for InverseCurrent<T> where T: NumLike {
4712 type Output = InverseEnergy<T>;
4713 fn div(self, rhs: MagneticFlux<T>) -> Self::Output {
4714 InverseEnergy{per_J: self.per_A / rhs.Wb}
4715 }
4716}
4717impl<T> core::ops::Div<MagneticFlux<T>> for &InverseCurrent<T> where T: NumLike {
4719 type Output = InverseEnergy<T>;
4720 fn div(self, rhs: MagneticFlux<T>) -> Self::Output {
4721 InverseEnergy{per_J: self.per_A.clone() / rhs.Wb}
4722 }
4723}
4724impl<T> core::ops::Div<&MagneticFlux<T>> for InverseCurrent<T> where T: NumLike {
4726 type Output = InverseEnergy<T>;
4727 fn div(self, rhs: &MagneticFlux<T>) -> Self::Output {
4728 InverseEnergy{per_J: self.per_A / rhs.Wb.clone()}
4729 }
4730}
4731impl<T> core::ops::Div<&MagneticFlux<T>> for &InverseCurrent<T> where T: NumLike {
4733 type Output = InverseEnergy<T>;
4734 fn div(self, rhs: &MagneticFlux<T>) -> Self::Output {
4735 InverseEnergy{per_J: self.per_A.clone() / rhs.Wb.clone()}
4736 }
4737}
4738
4739impl<T> core::ops::Div<Resistance<T>> for InverseCurrent<T> where T: NumLike {
4742 type Output = InverseVoltage<T>;
4743 fn div(self, rhs: Resistance<T>) -> Self::Output {
4744 InverseVoltage{per_V: self.per_A / rhs.Ohm}
4745 }
4746}
4747impl<T> core::ops::Div<Resistance<T>> for &InverseCurrent<T> where T: NumLike {
4749 type Output = InverseVoltage<T>;
4750 fn div(self, rhs: Resistance<T>) -> Self::Output {
4751 InverseVoltage{per_V: self.per_A.clone() / rhs.Ohm}
4752 }
4753}
4754impl<T> core::ops::Div<&Resistance<T>> for InverseCurrent<T> where T: NumLike {
4756 type Output = InverseVoltage<T>;
4757 fn div(self, rhs: &Resistance<T>) -> Self::Output {
4758 InverseVoltage{per_V: self.per_A / rhs.Ohm.clone()}
4759 }
4760}
4761impl<T> core::ops::Div<&Resistance<T>> for &InverseCurrent<T> where T: NumLike {
4763 type Output = InverseVoltage<T>;
4764 fn div(self, rhs: &Resistance<T>) -> Self::Output {
4765 InverseVoltage{per_V: self.per_A.clone() / rhs.Ohm.clone()}
4766 }
4767}
4768
4769impl<T> core::ops::Mul<Voltage<T>> for InverseCurrent<T> where T: NumLike {
4772 type Output = Resistance<T>;
4773 fn mul(self, rhs: Voltage<T>) -> Self::Output {
4774 Resistance{Ohm: self.per_A * rhs.V}
4775 }
4776}
4777impl<T> core::ops::Mul<Voltage<T>> for &InverseCurrent<T> where T: NumLike {
4779 type Output = Resistance<T>;
4780 fn mul(self, rhs: Voltage<T>) -> Self::Output {
4781 Resistance{Ohm: self.per_A.clone() * rhs.V}
4782 }
4783}
4784impl<T> core::ops::Mul<&Voltage<T>> for InverseCurrent<T> where T: NumLike {
4786 type Output = Resistance<T>;
4787 fn mul(self, rhs: &Voltage<T>) -> Self::Output {
4788 Resistance{Ohm: self.per_A * rhs.V.clone()}
4789 }
4790}
4791impl<T> core::ops::Mul<&Voltage<T>> for &InverseCurrent<T> where T: NumLike {
4793 type Output = Resistance<T>;
4794 fn mul(self, rhs: &Voltage<T>) -> Self::Output {
4795 Resistance{Ohm: self.per_A.clone() * rhs.V.clone()}
4796 }
4797}
4798
4799impl<T> core::ops::Div<Voltage<T>> for InverseCurrent<T> where T: NumLike {
4802 type Output = InversePower<T>;
4803 fn div(self, rhs: Voltage<T>) -> Self::Output {
4804 InversePower{per_W: self.per_A / rhs.V}
4805 }
4806}
4807impl<T> core::ops::Div<Voltage<T>> for &InverseCurrent<T> where T: NumLike {
4809 type Output = InversePower<T>;
4810 fn div(self, rhs: Voltage<T>) -> Self::Output {
4811 InversePower{per_W: self.per_A.clone() / rhs.V}
4812 }
4813}
4814impl<T> core::ops::Div<&Voltage<T>> for InverseCurrent<T> where T: NumLike {
4816 type Output = InversePower<T>;
4817 fn div(self, rhs: &Voltage<T>) -> Self::Output {
4818 InversePower{per_W: self.per_A / rhs.V.clone()}
4819 }
4820}
4821impl<T> core::ops::Div<&Voltage<T>> for &InverseCurrent<T> where T: NumLike {
4823 type Output = InversePower<T>;
4824 fn div(self, rhs: &Voltage<T>) -> Self::Output {
4825 InversePower{per_W: self.per_A.clone() / rhs.V.clone()}
4826 }
4827}
4828
4829impl<T> core::ops::Mul<Energy<T>> for InverseCurrent<T> where T: NumLike {
4832 type Output = MagneticFlux<T>;
4833 fn mul(self, rhs: Energy<T>) -> Self::Output {
4834 MagneticFlux{Wb: self.per_A * rhs.J}
4835 }
4836}
4837impl<T> core::ops::Mul<Energy<T>> for &InverseCurrent<T> where T: NumLike {
4839 type Output = MagneticFlux<T>;
4840 fn mul(self, rhs: Energy<T>) -> Self::Output {
4841 MagneticFlux{Wb: self.per_A.clone() * rhs.J}
4842 }
4843}
4844impl<T> core::ops::Mul<&Energy<T>> for InverseCurrent<T> where T: NumLike {
4846 type Output = MagneticFlux<T>;
4847 fn mul(self, rhs: &Energy<T>) -> Self::Output {
4848 MagneticFlux{Wb: self.per_A * rhs.J.clone()}
4849 }
4850}
4851impl<T> core::ops::Mul<&Energy<T>> for &InverseCurrent<T> where T: NumLike {
4853 type Output = MagneticFlux<T>;
4854 fn mul(self, rhs: &Energy<T>) -> Self::Output {
4855 MagneticFlux{Wb: self.per_A.clone() * rhs.J.clone()}
4856 }
4857}
4858
4859impl<T> core::ops::Mul<Torque<T>> for InverseCurrent<T> where T: NumLike {
4862 type Output = MagneticFlux<T>;
4863 fn mul(self, rhs: Torque<T>) -> Self::Output {
4864 MagneticFlux{Wb: self.per_A * rhs.Nm}
4865 }
4866}
4867impl<T> core::ops::Mul<Torque<T>> for &InverseCurrent<T> where T: NumLike {
4869 type Output = MagneticFlux<T>;
4870 fn mul(self, rhs: Torque<T>) -> Self::Output {
4871 MagneticFlux{Wb: self.per_A.clone() * rhs.Nm}
4872 }
4873}
4874impl<T> core::ops::Mul<&Torque<T>> for InverseCurrent<T> where T: NumLike {
4876 type Output = MagneticFlux<T>;
4877 fn mul(self, rhs: &Torque<T>) -> Self::Output {
4878 MagneticFlux{Wb: self.per_A * rhs.Nm.clone()}
4879 }
4880}
4881impl<T> core::ops::Mul<&Torque<T>> for &InverseCurrent<T> where T: NumLike {
4883 type Output = MagneticFlux<T>;
4884 fn mul(self, rhs: &Torque<T>) -> Self::Output {
4885 MagneticFlux{Wb: self.per_A.clone() * rhs.Nm.clone()}
4886 }
4887}
4888
4889impl<T> core::ops::Mul<Frequency<T>> for InverseCurrent<T> where T: NumLike {
4892 type Output = InverseCharge<T>;
4893 fn mul(self, rhs: Frequency<T>) -> Self::Output {
4894 InverseCharge{per_C: self.per_A * rhs.Hz}
4895 }
4896}
4897impl<T> core::ops::Mul<Frequency<T>> for &InverseCurrent<T> where T: NumLike {
4899 type Output = InverseCharge<T>;
4900 fn mul(self, rhs: Frequency<T>) -> Self::Output {
4901 InverseCharge{per_C: self.per_A.clone() * rhs.Hz}
4902 }
4903}
4904impl<T> core::ops::Mul<&Frequency<T>> for InverseCurrent<T> where T: NumLike {
4906 type Output = InverseCharge<T>;
4907 fn mul(self, rhs: &Frequency<T>) -> Self::Output {
4908 InverseCharge{per_C: self.per_A * rhs.Hz.clone()}
4909 }
4910}
4911impl<T> core::ops::Mul<&Frequency<T>> for &InverseCurrent<T> where T: NumLike {
4913 type Output = InverseCharge<T>;
4914 fn mul(self, rhs: &Frequency<T>) -> Self::Output {
4915 InverseCharge{per_C: self.per_A.clone() * rhs.Hz.clone()}
4916 }
4917}
4918
4919impl<T> core::ops::Div<InverseEnergy<T>> for InverseCurrent<T> where T: NumLike {
4922 type Output = MagneticFlux<T>;
4923 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
4924 MagneticFlux{Wb: self.per_A / rhs.per_J}
4925 }
4926}
4927impl<T> core::ops::Div<InverseEnergy<T>> for &InverseCurrent<T> where T: NumLike {
4929 type Output = MagneticFlux<T>;
4930 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
4931 MagneticFlux{Wb: self.per_A.clone() / rhs.per_J}
4932 }
4933}
4934impl<T> core::ops::Div<&InverseEnergy<T>> for InverseCurrent<T> where T: NumLike {
4936 type Output = MagneticFlux<T>;
4937 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
4938 MagneticFlux{Wb: self.per_A / rhs.per_J.clone()}
4939 }
4940}
4941impl<T> core::ops::Div<&InverseEnergy<T>> for &InverseCurrent<T> where T: NumLike {
4943 type Output = MagneticFlux<T>;
4944 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
4945 MagneticFlux{Wb: self.per_A.clone() / rhs.per_J.clone()}
4946 }
4947}
4948
4949impl<T> core::ops::Div<InverseTorque<T>> for InverseCurrent<T> where T: NumLike {
4952 type Output = MagneticFlux<T>;
4953 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
4954 MagneticFlux{Wb: self.per_A / rhs.per_Nm}
4955 }
4956}
4957impl<T> core::ops::Div<InverseTorque<T>> for &InverseCurrent<T> where T: NumLike {
4959 type Output = MagneticFlux<T>;
4960 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
4961 MagneticFlux{Wb: self.per_A.clone() / rhs.per_Nm}
4962 }
4963}
4964impl<T> core::ops::Div<&InverseTorque<T>> for InverseCurrent<T> where T: NumLike {
4966 type Output = MagneticFlux<T>;
4967 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
4968 MagneticFlux{Wb: self.per_A / rhs.per_Nm.clone()}
4969 }
4970}
4971impl<T> core::ops::Div<&InverseTorque<T>> for &InverseCurrent<T> where T: NumLike {
4973 type Output = MagneticFlux<T>;
4974 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
4975 MagneticFlux{Wb: self.per_A.clone() / rhs.per_Nm.clone()}
4976 }
4977}
4978
4979impl<T> core::ops::Div<InversePower<T>> for InverseCurrent<T> where T: NumLike {
4982 type Output = Voltage<T>;
4983 fn div(self, rhs: InversePower<T>) -> Self::Output {
4984 Voltage{V: self.per_A / rhs.per_W}
4985 }
4986}
4987impl<T> core::ops::Div<InversePower<T>> for &InverseCurrent<T> where T: NumLike {
4989 type Output = Voltage<T>;
4990 fn div(self, rhs: InversePower<T>) -> Self::Output {
4991 Voltage{V: self.per_A.clone() / rhs.per_W}
4992 }
4993}
4994impl<T> core::ops::Div<&InversePower<T>> for InverseCurrent<T> where T: NumLike {
4996 type Output = Voltage<T>;
4997 fn div(self, rhs: &InversePower<T>) -> Self::Output {
4998 Voltage{V: self.per_A / rhs.per_W.clone()}
4999 }
5000}
5001impl<T> core::ops::Div<&InversePower<T>> for &InverseCurrent<T> where T: NumLike {
5003 type Output = Voltage<T>;
5004 fn div(self, rhs: &InversePower<T>) -> Self::Output {
5005 Voltage{V: self.per_A.clone() / rhs.per_W.clone()}
5006 }
5007}
5008
5009impl<T> core::ops::Mul<Power<T>> for InverseCurrent<T> where T: NumLike {
5012 type Output = Voltage<T>;
5013 fn mul(self, rhs: Power<T>) -> Self::Output {
5014 Voltage{V: self.per_A * rhs.W}
5015 }
5016}
5017impl<T> core::ops::Mul<Power<T>> for &InverseCurrent<T> where T: NumLike {
5019 type Output = Voltage<T>;
5020 fn mul(self, rhs: Power<T>) -> Self::Output {
5021 Voltage{V: self.per_A.clone() * rhs.W}
5022 }
5023}
5024impl<T> core::ops::Mul<&Power<T>> for InverseCurrent<T> where T: NumLike {
5026 type Output = Voltage<T>;
5027 fn mul(self, rhs: &Power<T>) -> Self::Output {
5028 Voltage{V: self.per_A * rhs.W.clone()}
5029 }
5030}
5031impl<T> core::ops::Mul<&Power<T>> for &InverseCurrent<T> where T: NumLike {
5033 type Output = Voltage<T>;
5034 fn mul(self, rhs: &Power<T>) -> Self::Output {
5035 Voltage{V: self.per_A.clone() * rhs.W.clone()}
5036 }
5037}
5038
5039impl<T> core::ops::Div<InverseCurrent<T>> for f64 where T: NumLike+From<f64> {
5042 type Output = Current<T>;
5043 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5044 Current{A: T::from(self) / rhs.per_A}
5045 }
5046}
5047impl<T> core::ops::Div<InverseCurrent<T>> for &f64 where T: NumLike+From<f64> {
5049 type Output = Current<T>;
5050 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5051 Current{A: T::from(self.clone()) / rhs.per_A}
5052 }
5053}
5054impl<T> core::ops::Div<&InverseCurrent<T>> for f64 where T: NumLike+From<f64> {
5056 type Output = Current<T>;
5057 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5058 Current{A: T::from(self) / rhs.per_A.clone()}
5059 }
5060}
5061impl<T> core::ops::Div<&InverseCurrent<T>> for &f64 where T: NumLike+From<f64> {
5063 type Output = Current<T>;
5064 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5065 Current{A: T::from(self.clone()) / rhs.per_A.clone()}
5066 }
5067}
5068
5069impl<T> core::ops::Div<InverseCurrent<T>> for f32 where T: NumLike+From<f32> {
5072 type Output = Current<T>;
5073 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5074 Current{A: T::from(self) / rhs.per_A}
5075 }
5076}
5077impl<T> core::ops::Div<InverseCurrent<T>> for &f32 where T: NumLike+From<f32> {
5079 type Output = Current<T>;
5080 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5081 Current{A: T::from(self.clone()) / rhs.per_A}
5082 }
5083}
5084impl<T> core::ops::Div<&InverseCurrent<T>> for f32 where T: NumLike+From<f32> {
5086 type Output = Current<T>;
5087 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5088 Current{A: T::from(self) / rhs.per_A.clone()}
5089 }
5090}
5091impl<T> core::ops::Div<&InverseCurrent<T>> for &f32 where T: NumLike+From<f32> {
5093 type Output = Current<T>;
5094 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5095 Current{A: T::from(self.clone()) / rhs.per_A.clone()}
5096 }
5097}
5098
5099impl<T> core::ops::Div<InverseCurrent<T>> for i64 where T: NumLike+From<i64> {
5102 type Output = Current<T>;
5103 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5104 Current{A: T::from(self) / rhs.per_A}
5105 }
5106}
5107impl<T> core::ops::Div<InverseCurrent<T>> for &i64 where T: NumLike+From<i64> {
5109 type Output = Current<T>;
5110 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5111 Current{A: T::from(self.clone()) / rhs.per_A}
5112 }
5113}
5114impl<T> core::ops::Div<&InverseCurrent<T>> for i64 where T: NumLike+From<i64> {
5116 type Output = Current<T>;
5117 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5118 Current{A: T::from(self) / rhs.per_A.clone()}
5119 }
5120}
5121impl<T> core::ops::Div<&InverseCurrent<T>> for &i64 where T: NumLike+From<i64> {
5123 type Output = Current<T>;
5124 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5125 Current{A: T::from(self.clone()) / rhs.per_A.clone()}
5126 }
5127}
5128
5129impl<T> core::ops::Div<InverseCurrent<T>> for i32 where T: NumLike+From<i32> {
5132 type Output = Current<T>;
5133 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5134 Current{A: T::from(self) / rhs.per_A}
5135 }
5136}
5137impl<T> core::ops::Div<InverseCurrent<T>> for &i32 where T: NumLike+From<i32> {
5139 type Output = Current<T>;
5140 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5141 Current{A: T::from(self.clone()) / rhs.per_A}
5142 }
5143}
5144impl<T> core::ops::Div<&InverseCurrent<T>> for i32 where T: NumLike+From<i32> {
5146 type Output = Current<T>;
5147 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5148 Current{A: T::from(self) / rhs.per_A.clone()}
5149 }
5150}
5151impl<T> core::ops::Div<&InverseCurrent<T>> for &i32 where T: NumLike+From<i32> {
5153 type Output = Current<T>;
5154 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5155 Current{A: T::from(self.clone()) / rhs.per_A.clone()}
5156 }
5157}
5158
5159#[cfg(feature="num-bigfloat")]
5162impl<T> core::ops::Div<InverseCurrent<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5163 type Output = Current<T>;
5164 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5165 Current{A: T::from(self) / rhs.per_A}
5166 }
5167}
5168#[cfg(feature="num-bigfloat")]
5170impl<T> core::ops::Div<InverseCurrent<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5171 type Output = Current<T>;
5172 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5173 Current{A: T::from(self.clone()) / rhs.per_A}
5174 }
5175}
5176#[cfg(feature="num-bigfloat")]
5178impl<T> core::ops::Div<&InverseCurrent<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5179 type Output = Current<T>;
5180 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5181 Current{A: T::from(self) / rhs.per_A.clone()}
5182 }
5183}
5184#[cfg(feature="num-bigfloat")]
5186impl<T> core::ops::Div<&InverseCurrent<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
5187 type Output = Current<T>;
5188 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5189 Current{A: T::from(self.clone()) / rhs.per_A.clone()}
5190 }
5191}
5192
5193#[cfg(feature="num-complex")]
5196impl<T> core::ops::Div<InverseCurrent<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5197 type Output = Current<T>;
5198 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5199 Current{A: T::from(self) / rhs.per_A}
5200 }
5201}
5202#[cfg(feature="num-complex")]
5204impl<T> core::ops::Div<InverseCurrent<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5205 type Output = Current<T>;
5206 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5207 Current{A: T::from(self.clone()) / rhs.per_A}
5208 }
5209}
5210#[cfg(feature="num-complex")]
5212impl<T> core::ops::Div<&InverseCurrent<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5213 type Output = Current<T>;
5214 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5215 Current{A: T::from(self) / rhs.per_A.clone()}
5216 }
5217}
5218#[cfg(feature="num-complex")]
5220impl<T> core::ops::Div<&InverseCurrent<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
5221 type Output = Current<T>;
5222 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5223 Current{A: T::from(self.clone()) / rhs.per_A.clone()}
5224 }
5225}
5226
5227#[cfg(feature="num-complex")]
5230impl<T> core::ops::Div<InverseCurrent<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
5231 type Output = Current<T>;
5232 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5233 Current{A: T::from(self) / rhs.per_A}
5234 }
5235}
5236#[cfg(feature="num-complex")]
5238impl<T> core::ops::Div<InverseCurrent<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
5239 type Output = Current<T>;
5240 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
5241 Current{A: T::from(self.clone()) / rhs.per_A}
5242 }
5243}
5244#[cfg(feature="num-complex")]
5246impl<T> core::ops::Div<&InverseCurrent<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
5247 type Output = Current<T>;
5248 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5249 Current{A: T::from(self) / rhs.per_A.clone()}
5250 }
5251}
5252#[cfg(feature="num-complex")]
5254impl<T> core::ops::Div<&InverseCurrent<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
5255 type Output = Current<T>;
5256 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
5257 Current{A: T::from(self.clone()) / rhs.per_A.clone()}
5258 }
5259}
5260
5261#[derive(UnitStruct, Debug, Clone)]
5263#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
5264pub struct InverseDistance<T: NumLike>{
5265 pub per_m: T
5267}
5268
5269impl<T> InverseDistance<T> where T: NumLike {
5270
5271 pub fn unit_name() -> &'static str { "inverse meters" }
5273
5274 pub fn unit_symbol() -> &'static str { "1/m" }
5276
5277 pub fn from_per_m(per_m: T) -> Self { InverseDistance{per_m: per_m} }
5282
5283 pub fn to_per_m(&self) -> T { self.per_m.clone() }
5285
5286 pub fn from_per_meter(per_meter: T) -> Self { InverseDistance{per_m: per_meter} }
5291
5292 pub fn to_per_meter(&self) -> T { self.per_m.clone() }
5294
5295}
5296
5297impl<T> fmt::Display for InverseDistance<T> where T: NumLike {
5298 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5299 write!(f, "{} {}", &self.per_m, Self::unit_symbol())
5300 }
5301}
5302
5303impl<T> InverseDistance<T> where T: NumLike+From<f64> {
5304
5305 pub fn to_per_cm(&self) -> T {
5309 return self.per_m.clone() * T::from(0.01_f64);
5310 }
5311
5312 pub fn from_per_cm(per_cm: T) -> Self {
5319 InverseDistance{per_m: per_cm * T::from(100.0_f64)}
5320 }
5321
5322 pub fn to_per_mm(&self) -> T {
5326 return self.per_m.clone() * T::from(0.001_f64);
5327 }
5328
5329 pub fn from_per_mm(per_mm: T) -> Self {
5336 InverseDistance{per_m: per_mm * T::from(1000.0_f64)}
5337 }
5338
5339 pub fn to_per_um(&self) -> T {
5343 return self.per_m.clone() * T::from(1e-06_f64);
5344 }
5345
5346 pub fn from_per_um(per_um: T) -> Self {
5353 InverseDistance{per_m: per_um * T::from(1000000.0_f64)}
5354 }
5355
5356 pub fn to_per_nm(&self) -> T {
5360 return self.per_m.clone() * T::from(1e-09_f64);
5361 }
5362
5363 pub fn from_per_nm(per_nm: T) -> Self {
5370 InverseDistance{per_m: per_nm * T::from(1000000000.0_f64)}
5371 }
5372
5373 pub fn to_per_pm(&self) -> T {
5377 return self.per_m.clone() * T::from(1e-12_f64);
5378 }
5379
5380 pub fn from_per_pm(per_pm: T) -> Self {
5387 InverseDistance{per_m: per_pm * T::from(1000000000000.0_f64)}
5388 }
5389
5390 pub fn to_per_km(&self) -> T {
5394 return self.per_m.clone() * T::from(1000.0_f64);
5395 }
5396
5397 pub fn from_per_km(per_km: T) -> Self {
5404 InverseDistance{per_m: per_km * T::from(0.001_f64)}
5405 }
5406
5407 pub fn to_per_au(&self) -> T {
5411 return self.per_m.clone() * T::from(149597870700.0_f64);
5412 }
5413
5414 pub fn from_per_au(per_au: T) -> Self {
5421 InverseDistance{per_m: per_au * T::from(6.68e-12_f64)}
5422 }
5423
5424 pub fn to_per_parsec(&self) -> T {
5428 return self.per_m.clone() * T::from(3.09e+16_f64);
5429 }
5430
5431 pub fn from_per_parsec(per_parsec: T) -> Self {
5438 InverseDistance{per_m: per_parsec * T::from(3.24e-17_f64)}
5439 }
5440
5441 pub fn to_per_lyr(&self) -> T {
5445 return self.per_m.clone() * T::from(9460528169656200.0_f64);
5446 }
5447
5448 pub fn from_per_lyr(per_lyr: T) -> Self {
5455 InverseDistance{per_m: per_lyr * T::from(1.06e-16_f64)}
5456 }
5457
5458}
5459
5460
5461#[cfg(feature="num-bigfloat")]
5463impl core::ops::Mul<InverseDistance<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
5464 type Output = InverseDistance<num_bigfloat::BigFloat>;
5465 fn mul(self, rhs: InverseDistance<num_bigfloat::BigFloat>) -> Self::Output {
5466 InverseDistance{per_m: self * rhs.per_m}
5467 }
5468}
5469#[cfg(feature="num-bigfloat")]
5471impl core::ops::Mul<InverseDistance<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
5472 type Output = InverseDistance<num_bigfloat::BigFloat>;
5473 fn mul(self, rhs: InverseDistance<num_bigfloat::BigFloat>) -> Self::Output {
5474 InverseDistance{per_m: self.clone() * rhs.per_m}
5475 }
5476}
5477#[cfg(feature="num-bigfloat")]
5479impl core::ops::Mul<&InverseDistance<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
5480 type Output = InverseDistance<num_bigfloat::BigFloat>;
5481 fn mul(self, rhs: &InverseDistance<num_bigfloat::BigFloat>) -> Self::Output {
5482 InverseDistance{per_m: self * rhs.per_m.clone()}
5483 }
5484}
5485#[cfg(feature="num-bigfloat")]
5487impl core::ops::Mul<&InverseDistance<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
5488 type Output = InverseDistance<num_bigfloat::BigFloat>;
5489 fn mul(self, rhs: &InverseDistance<num_bigfloat::BigFloat>) -> Self::Output {
5490 InverseDistance{per_m: self.clone() * rhs.per_m.clone()}
5491 }
5492}
5493
5494#[cfg(feature="num-complex")]
5496impl core::ops::Mul<InverseDistance<num_complex::Complex32>> for num_complex::Complex32 {
5497 type Output = InverseDistance<num_complex::Complex32>;
5498 fn mul(self, rhs: InverseDistance<num_complex::Complex32>) -> Self::Output {
5499 InverseDistance{per_m: self * rhs.per_m}
5500 }
5501}
5502#[cfg(feature="num-complex")]
5504impl core::ops::Mul<InverseDistance<num_complex::Complex32>> for &num_complex::Complex32 {
5505 type Output = InverseDistance<num_complex::Complex32>;
5506 fn mul(self, rhs: InverseDistance<num_complex::Complex32>) -> Self::Output {
5507 InverseDistance{per_m: self.clone() * rhs.per_m}
5508 }
5509}
5510#[cfg(feature="num-complex")]
5512impl core::ops::Mul<&InverseDistance<num_complex::Complex32>> for num_complex::Complex32 {
5513 type Output = InverseDistance<num_complex::Complex32>;
5514 fn mul(self, rhs: &InverseDistance<num_complex::Complex32>) -> Self::Output {
5515 InverseDistance{per_m: self * rhs.per_m.clone()}
5516 }
5517}
5518#[cfg(feature="num-complex")]
5520impl core::ops::Mul<&InverseDistance<num_complex::Complex32>> for &num_complex::Complex32 {
5521 type Output = InverseDistance<num_complex::Complex32>;
5522 fn mul(self, rhs: &InverseDistance<num_complex::Complex32>) -> Self::Output {
5523 InverseDistance{per_m: self.clone() * rhs.per_m.clone()}
5524 }
5525}
5526
5527#[cfg(feature="num-complex")]
5529impl core::ops::Mul<InverseDistance<num_complex::Complex64>> for num_complex::Complex64 {
5530 type Output = InverseDistance<num_complex::Complex64>;
5531 fn mul(self, rhs: InverseDistance<num_complex::Complex64>) -> Self::Output {
5532 InverseDistance{per_m: self * rhs.per_m}
5533 }
5534}
5535#[cfg(feature="num-complex")]
5537impl core::ops::Mul<InverseDistance<num_complex::Complex64>> for &num_complex::Complex64 {
5538 type Output = InverseDistance<num_complex::Complex64>;
5539 fn mul(self, rhs: InverseDistance<num_complex::Complex64>) -> Self::Output {
5540 InverseDistance{per_m: self.clone() * rhs.per_m}
5541 }
5542}
5543#[cfg(feature="num-complex")]
5545impl core::ops::Mul<&InverseDistance<num_complex::Complex64>> for num_complex::Complex64 {
5546 type Output = InverseDistance<num_complex::Complex64>;
5547 fn mul(self, rhs: &InverseDistance<num_complex::Complex64>) -> Self::Output {
5548 InverseDistance{per_m: self * rhs.per_m.clone()}
5549 }
5550}
5551#[cfg(feature="num-complex")]
5553impl core::ops::Mul<&InverseDistance<num_complex::Complex64>> for &num_complex::Complex64 {
5554 type Output = InverseDistance<num_complex::Complex64>;
5555 fn mul(self, rhs: &InverseDistance<num_complex::Complex64>) -> Self::Output {
5556 InverseDistance{per_m: self.clone() * rhs.per_m.clone()}
5557 }
5558}
5559
5560
5561
5562#[cfg(feature = "uom")]
5564impl<T> Into<uom::si::f32::LinearNumberDensity> for InverseDistance<T> where T: NumLike+Into<f32> {
5565 fn into(self) -> uom::si::f32::LinearNumberDensity {
5566 uom::si::f32::LinearNumberDensity::new::<uom::si::linear_number_density::per_meter>(self.per_m.into())
5567 }
5568}
5569
5570#[cfg(feature = "uom")]
5572impl<T> From<uom::si::f32::LinearNumberDensity> for InverseDistance<T> where T: NumLike+From<f32> {
5573 fn from(src: uom::si::f32::LinearNumberDensity) -> Self {
5574 InverseDistance{per_m: T::from(src.value)}
5575 }
5576}
5577
5578#[cfg(feature = "uom")]
5580impl<T> Into<uom::si::f64::LinearNumberDensity> for InverseDistance<T> where T: NumLike+Into<f64> {
5581 fn into(self) -> uom::si::f64::LinearNumberDensity {
5582 uom::si::f64::LinearNumberDensity::new::<uom::si::linear_number_density::per_meter>(self.per_m.into())
5583 }
5584}
5585
5586#[cfg(feature = "uom")]
5588impl<T> From<uom::si::f64::LinearNumberDensity> for InverseDistance<T> where T: NumLike+From<f64> {
5589 fn from(src: uom::si::f64::LinearNumberDensity) -> Self {
5590 InverseDistance{per_m: T::from(src.value)}
5591 }
5592}
5593
5594
5595impl<T> core::ops::Div<Distance<T>> for InverseDistance<T> where T: NumLike {
5598 type Output = InverseArea<T>;
5599 fn div(self, rhs: Distance<T>) -> Self::Output {
5600 InverseArea{per_m2: self.per_m / rhs.m}
5601 }
5602}
5603impl<T> core::ops::Div<Distance<T>> for &InverseDistance<T> where T: NumLike {
5605 type Output = InverseArea<T>;
5606 fn div(self, rhs: Distance<T>) -> Self::Output {
5607 InverseArea{per_m2: self.per_m.clone() / rhs.m}
5608 }
5609}
5610impl<T> core::ops::Div<&Distance<T>> for InverseDistance<T> where T: NumLike {
5612 type Output = InverseArea<T>;
5613 fn div(self, rhs: &Distance<T>) -> Self::Output {
5614 InverseArea{per_m2: self.per_m / rhs.m.clone()}
5615 }
5616}
5617impl<T> core::ops::Div<&Distance<T>> for &InverseDistance<T> where T: NumLike {
5619 type Output = InverseArea<T>;
5620 fn div(self, rhs: &Distance<T>) -> Self::Output {
5621 InverseArea{per_m2: self.per_m.clone() / rhs.m.clone()}
5622 }
5623}
5624
5625impl<T> core::ops::Mul<InverseDistance<T>> for InverseDistance<T> where T: NumLike {
5628 type Output = InverseArea<T>;
5629 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
5630 InverseArea{per_m2: self.per_m * rhs.per_m}
5631 }
5632}
5633impl<T> core::ops::Mul<InverseDistance<T>> for &InverseDistance<T> where T: NumLike {
5635 type Output = InverseArea<T>;
5636 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
5637 InverseArea{per_m2: self.per_m.clone() * rhs.per_m}
5638 }
5639}
5640impl<T> core::ops::Mul<&InverseDistance<T>> for InverseDistance<T> where T: NumLike {
5642 type Output = InverseArea<T>;
5643 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
5644 InverseArea{per_m2: self.per_m * rhs.per_m.clone()}
5645 }
5646}
5647impl<T> core::ops::Mul<&InverseDistance<T>> for &InverseDistance<T> where T: NumLike {
5649 type Output = InverseArea<T>;
5650 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
5651 InverseArea{per_m2: self.per_m.clone() * rhs.per_m.clone()}
5652 }
5653}
5654
5655impl<T> core::ops::Mul<Time<T>> for InverseDistance<T> where T: NumLike {
5658 type Output = TimePerDistance<T>;
5659 fn mul(self, rhs: Time<T>) -> Self::Output {
5660 TimePerDistance{spm: self.per_m * rhs.s}
5661 }
5662}
5663impl<T> core::ops::Mul<Time<T>> for &InverseDistance<T> where T: NumLike {
5665 type Output = TimePerDistance<T>;
5666 fn mul(self, rhs: Time<T>) -> Self::Output {
5667 TimePerDistance{spm: self.per_m.clone() * rhs.s}
5668 }
5669}
5670impl<T> core::ops::Mul<&Time<T>> for InverseDistance<T> where T: NumLike {
5672 type Output = TimePerDistance<T>;
5673 fn mul(self, rhs: &Time<T>) -> Self::Output {
5674 TimePerDistance{spm: self.per_m * rhs.s.clone()}
5675 }
5676}
5677impl<T> core::ops::Mul<&Time<T>> for &InverseDistance<T> where T: NumLike {
5679 type Output = TimePerDistance<T>;
5680 fn mul(self, rhs: &Time<T>) -> Self::Output {
5681 TimePerDistance{spm: self.per_m.clone() * rhs.s.clone()}
5682 }
5683}
5684
5685impl<T> core::ops::Mul<Area<T>> for InverseDistance<T> where T: NumLike {
5688 type Output = Distance<T>;
5689 fn mul(self, rhs: Area<T>) -> Self::Output {
5690 Distance{m: self.per_m * rhs.m2}
5691 }
5692}
5693impl<T> core::ops::Mul<Area<T>> for &InverseDistance<T> where T: NumLike {
5695 type Output = Distance<T>;
5696 fn mul(self, rhs: Area<T>) -> Self::Output {
5697 Distance{m: self.per_m.clone() * rhs.m2}
5698 }
5699}
5700impl<T> core::ops::Mul<&Area<T>> for InverseDistance<T> where T: NumLike {
5702 type Output = Distance<T>;
5703 fn mul(self, rhs: &Area<T>) -> Self::Output {
5704 Distance{m: self.per_m * rhs.m2.clone()}
5705 }
5706}
5707impl<T> core::ops::Mul<&Area<T>> for &InverseDistance<T> where T: NumLike {
5709 type Output = Distance<T>;
5710 fn mul(self, rhs: &Area<T>) -> Self::Output {
5711 Distance{m: self.per_m.clone() * rhs.m2.clone()}
5712 }
5713}
5714
5715impl<T> core::ops::Div<Area<T>> for InverseDistance<T> where T: NumLike {
5718 type Output = InverseVolume<T>;
5719 fn div(self, rhs: Area<T>) -> Self::Output {
5720 InverseVolume{per_m3: self.per_m / rhs.m2}
5721 }
5722}
5723impl<T> core::ops::Div<Area<T>> for &InverseDistance<T> where T: NumLike {
5725 type Output = InverseVolume<T>;
5726 fn div(self, rhs: Area<T>) -> Self::Output {
5727 InverseVolume{per_m3: self.per_m.clone() / rhs.m2}
5728 }
5729}
5730impl<T> core::ops::Div<&Area<T>> for InverseDistance<T> where T: NumLike {
5732 type Output = InverseVolume<T>;
5733 fn div(self, rhs: &Area<T>) -> Self::Output {
5734 InverseVolume{per_m3: self.per_m / rhs.m2.clone()}
5735 }
5736}
5737impl<T> core::ops::Div<&Area<T>> for &InverseDistance<T> where T: NumLike {
5739 type Output = InverseVolume<T>;
5740 fn div(self, rhs: &Area<T>) -> Self::Output {
5741 InverseVolume{per_m3: self.per_m.clone() / rhs.m2.clone()}
5742 }
5743}
5744
5745impl<T> core::ops::Mul<InverseArea<T>> for InverseDistance<T> where T: NumLike {
5748 type Output = InverseVolume<T>;
5749 fn mul(self, rhs: InverseArea<T>) -> Self::Output {
5750 InverseVolume{per_m3: self.per_m * rhs.per_m2}
5751 }
5752}
5753impl<T> core::ops::Mul<InverseArea<T>> for &InverseDistance<T> where T: NumLike {
5755 type Output = InverseVolume<T>;
5756 fn mul(self, rhs: InverseArea<T>) -> Self::Output {
5757 InverseVolume{per_m3: self.per_m.clone() * rhs.per_m2}
5758 }
5759}
5760impl<T> core::ops::Mul<&InverseArea<T>> for InverseDistance<T> where T: NumLike {
5762 type Output = InverseVolume<T>;
5763 fn mul(self, rhs: &InverseArea<T>) -> Self::Output {
5764 InverseVolume{per_m3: self.per_m * rhs.per_m2.clone()}
5765 }
5766}
5767impl<T> core::ops::Mul<&InverseArea<T>> for &InverseDistance<T> where T: NumLike {
5769 type Output = InverseVolume<T>;
5770 fn mul(self, rhs: &InverseArea<T>) -> Self::Output {
5771 InverseVolume{per_m3: self.per_m.clone() * rhs.per_m2.clone()}
5772 }
5773}
5774
5775impl<T> core::ops::Div<InverseArea<T>> for InverseDistance<T> where T: NumLike {
5778 type Output = Distance<T>;
5779 fn div(self, rhs: InverseArea<T>) -> Self::Output {
5780 Distance{m: self.per_m / rhs.per_m2}
5781 }
5782}
5783impl<T> core::ops::Div<InverseArea<T>> for &InverseDistance<T> where T: NumLike {
5785 type Output = Distance<T>;
5786 fn div(self, rhs: InverseArea<T>) -> Self::Output {
5787 Distance{m: self.per_m.clone() / rhs.per_m2}
5788 }
5789}
5790impl<T> core::ops::Div<&InverseArea<T>> for InverseDistance<T> where T: NumLike {
5792 type Output = Distance<T>;
5793 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
5794 Distance{m: self.per_m / rhs.per_m2.clone()}
5795 }
5796}
5797impl<T> core::ops::Div<&InverseArea<T>> for &InverseDistance<T> where T: NumLike {
5799 type Output = Distance<T>;
5800 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
5801 Distance{m: self.per_m.clone() / rhs.per_m2.clone()}
5802 }
5803}
5804
5805impl<T> core::ops::Div<InverseVolume<T>> for InverseDistance<T> where T: NumLike {
5808 type Output = Area<T>;
5809 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5810 Area{m2: self.per_m / rhs.per_m3}
5811 }
5812}
5813impl<T> core::ops::Div<InverseVolume<T>> for &InverseDistance<T> where T: NumLike {
5815 type Output = Area<T>;
5816 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
5817 Area{m2: self.per_m.clone() / rhs.per_m3}
5818 }
5819}
5820impl<T> core::ops::Div<&InverseVolume<T>> for InverseDistance<T> where T: NumLike {
5822 type Output = Area<T>;
5823 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5824 Area{m2: self.per_m / rhs.per_m3.clone()}
5825 }
5826}
5827impl<T> core::ops::Div<&InverseVolume<T>> for &InverseDistance<T> where T: NumLike {
5829 type Output = Area<T>;
5830 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
5831 Area{m2: self.per_m.clone() / rhs.per_m3.clone()}
5832 }
5833}
5834
5835impl<T> core::ops::Mul<Volume<T>> for InverseDistance<T> where T: NumLike {
5838 type Output = Area<T>;
5839 fn mul(self, rhs: Volume<T>) -> Self::Output {
5840 Area{m2: self.per_m * rhs.m3}
5841 }
5842}
5843impl<T> core::ops::Mul<Volume<T>> for &InverseDistance<T> where T: NumLike {
5845 type Output = Area<T>;
5846 fn mul(self, rhs: Volume<T>) -> Self::Output {
5847 Area{m2: self.per_m.clone() * rhs.m3}
5848 }
5849}
5850impl<T> core::ops::Mul<&Volume<T>> for InverseDistance<T> where T: NumLike {
5852 type Output = Area<T>;
5853 fn mul(self, rhs: &Volume<T>) -> Self::Output {
5854 Area{m2: self.per_m * rhs.m3.clone()}
5855 }
5856}
5857impl<T> core::ops::Mul<&Volume<T>> for &InverseDistance<T> where T: NumLike {
5859 type Output = Area<T>;
5860 fn mul(self, rhs: &Volume<T>) -> Self::Output {
5861 Area{m2: self.per_m.clone() * rhs.m3.clone()}
5862 }
5863}
5864
5865impl<T> core::ops::Mul<AreaDensity<T>> for InverseDistance<T> where T: NumLike {
5868 type Output = Density<T>;
5869 fn mul(self, rhs: AreaDensity<T>) -> Self::Output {
5870 Density{kgpm3: self.per_m * rhs.kgpm2}
5871 }
5872}
5873impl<T> core::ops::Mul<AreaDensity<T>> for &InverseDistance<T> where T: NumLike {
5875 type Output = Density<T>;
5876 fn mul(self, rhs: AreaDensity<T>) -> Self::Output {
5877 Density{kgpm3: self.per_m.clone() * rhs.kgpm2}
5878 }
5879}
5880impl<T> core::ops::Mul<&AreaDensity<T>> for InverseDistance<T> where T: NumLike {
5882 type Output = Density<T>;
5883 fn mul(self, rhs: &AreaDensity<T>) -> Self::Output {
5884 Density{kgpm3: self.per_m * rhs.kgpm2.clone()}
5885 }
5886}
5887impl<T> core::ops::Mul<&AreaDensity<T>> for &InverseDistance<T> where T: NumLike {
5889 type Output = Density<T>;
5890 fn mul(self, rhs: &AreaDensity<T>) -> Self::Output {
5891 Density{kgpm3: self.per_m.clone() * rhs.kgpm2.clone()}
5892 }
5893}
5894
5895impl<T> core::ops::Div<AreaPerMass<T>> for InverseDistance<T> where T: NumLike {
5898 type Output = Density<T>;
5899 fn div(self, rhs: AreaPerMass<T>) -> Self::Output {
5900 Density{kgpm3: self.per_m / rhs.m2_per_kg}
5901 }
5902}
5903impl<T> core::ops::Div<AreaPerMass<T>> for &InverseDistance<T> where T: NumLike {
5905 type Output = Density<T>;
5906 fn div(self, rhs: AreaPerMass<T>) -> Self::Output {
5907 Density{kgpm3: self.per_m.clone() / rhs.m2_per_kg}
5908 }
5909}
5910impl<T> core::ops::Div<&AreaPerMass<T>> for InverseDistance<T> where T: NumLike {
5912 type Output = Density<T>;
5913 fn div(self, rhs: &AreaPerMass<T>) -> Self::Output {
5914 Density{kgpm3: self.per_m / rhs.m2_per_kg.clone()}
5915 }
5916}
5917impl<T> core::ops::Div<&AreaPerMass<T>> for &InverseDistance<T> where T: NumLike {
5919 type Output = Density<T>;
5920 fn div(self, rhs: &AreaPerMass<T>) -> Self::Output {
5921 Density{kgpm3: self.per_m.clone() / rhs.m2_per_kg.clone()}
5922 }
5923}
5924
5925impl<T> core::ops::Div<Density<T>> for InverseDistance<T> where T: NumLike {
5928 type Output = AreaPerMass<T>;
5929 fn div(self, rhs: Density<T>) -> Self::Output {
5930 AreaPerMass{m2_per_kg: self.per_m / rhs.kgpm3}
5931 }
5932}
5933impl<T> core::ops::Div<Density<T>> for &InverseDistance<T> where T: NumLike {
5935 type Output = AreaPerMass<T>;
5936 fn div(self, rhs: Density<T>) -> Self::Output {
5937 AreaPerMass{m2_per_kg: self.per_m.clone() / rhs.kgpm3}
5938 }
5939}
5940impl<T> core::ops::Div<&Density<T>> for InverseDistance<T> where T: NumLike {
5942 type Output = AreaPerMass<T>;
5943 fn div(self, rhs: &Density<T>) -> Self::Output {
5944 AreaPerMass{m2_per_kg: self.per_m / rhs.kgpm3.clone()}
5945 }
5946}
5947impl<T> core::ops::Div<&Density<T>> for &InverseDistance<T> where T: NumLike {
5949 type Output = AreaPerMass<T>;
5950 fn div(self, rhs: &Density<T>) -> Self::Output {
5951 AreaPerMass{m2_per_kg: self.per_m.clone() / rhs.kgpm3.clone()}
5952 }
5953}
5954
5955impl<T> core::ops::Mul<Energy<T>> for InverseDistance<T> where T: NumLike {
5958 type Output = Force<T>;
5959 fn mul(self, rhs: Energy<T>) -> Self::Output {
5960 Force{N: self.per_m * rhs.J}
5961 }
5962}
5963impl<T> core::ops::Mul<Energy<T>> for &InverseDistance<T> where T: NumLike {
5965 type Output = Force<T>;
5966 fn mul(self, rhs: Energy<T>) -> Self::Output {
5967 Force{N: self.per_m.clone() * rhs.J}
5968 }
5969}
5970impl<T> core::ops::Mul<&Energy<T>> for InverseDistance<T> where T: NumLike {
5972 type Output = Force<T>;
5973 fn mul(self, rhs: &Energy<T>) -> Self::Output {
5974 Force{N: self.per_m * rhs.J.clone()}
5975 }
5976}
5977impl<T> core::ops::Mul<&Energy<T>> for &InverseDistance<T> where T: NumLike {
5979 type Output = Force<T>;
5980 fn mul(self, rhs: &Energy<T>) -> Self::Output {
5981 Force{N: self.per_m.clone() * rhs.J.clone()}
5982 }
5983}
5984
5985impl<T> core::ops::Mul<Torque<T>> for InverseDistance<T> where T: NumLike {
5988 type Output = Force<T>;
5989 fn mul(self, rhs: Torque<T>) -> Self::Output {
5990 Force{N: self.per_m * rhs.Nm}
5991 }
5992}
5993impl<T> core::ops::Mul<Torque<T>> for &InverseDistance<T> where T: NumLike {
5995 type Output = Force<T>;
5996 fn mul(self, rhs: Torque<T>) -> Self::Output {
5997 Force{N: self.per_m.clone() * rhs.Nm}
5998 }
5999}
6000impl<T> core::ops::Mul<&Torque<T>> for InverseDistance<T> where T: NumLike {
6002 type Output = Force<T>;
6003 fn mul(self, rhs: &Torque<T>) -> Self::Output {
6004 Force{N: self.per_m * rhs.Nm.clone()}
6005 }
6006}
6007impl<T> core::ops::Mul<&Torque<T>> for &InverseDistance<T> where T: NumLike {
6009 type Output = Force<T>;
6010 fn mul(self, rhs: &Torque<T>) -> Self::Output {
6011 Force{N: self.per_m.clone() * rhs.Nm.clone()}
6012 }
6013}
6014
6015impl<T> core::ops::Div<Force<T>> for InverseDistance<T> where T: NumLike {
6018 type Output = InverseEnergy<T>;
6019 fn div(self, rhs: Force<T>) -> Self::Output {
6020 InverseEnergy{per_J: self.per_m / rhs.N}
6021 }
6022}
6023impl<T> core::ops::Div<Force<T>> for &InverseDistance<T> where T: NumLike {
6025 type Output = InverseEnergy<T>;
6026 fn div(self, rhs: Force<T>) -> Self::Output {
6027 InverseEnergy{per_J: self.per_m.clone() / rhs.N}
6028 }
6029}
6030impl<T> core::ops::Div<&Force<T>> for InverseDistance<T> where T: NumLike {
6032 type Output = InverseEnergy<T>;
6033 fn div(self, rhs: &Force<T>) -> Self::Output {
6034 InverseEnergy{per_J: self.per_m / rhs.N.clone()}
6035 }
6036}
6037impl<T> core::ops::Div<&Force<T>> for &InverseDistance<T> where T: NumLike {
6039 type Output = InverseEnergy<T>;
6040 fn div(self, rhs: &Force<T>) -> Self::Output {
6041 InverseEnergy{per_J: self.per_m.clone() / rhs.N.clone()}
6042 }
6043}
6044
6045impl<T> core::ops::Div<Frequency<T>> for InverseDistance<T> where T: NumLike {
6048 type Output = TimePerDistance<T>;
6049 fn div(self, rhs: Frequency<T>) -> Self::Output {
6050 TimePerDistance{spm: self.per_m / rhs.Hz}
6051 }
6052}
6053impl<T> core::ops::Div<Frequency<T>> for &InverseDistance<T> where T: NumLike {
6055 type Output = TimePerDistance<T>;
6056 fn div(self, rhs: Frequency<T>) -> Self::Output {
6057 TimePerDistance{spm: self.per_m.clone() / rhs.Hz}
6058 }
6059}
6060impl<T> core::ops::Div<&Frequency<T>> for InverseDistance<T> where T: NumLike {
6062 type Output = TimePerDistance<T>;
6063 fn div(self, rhs: &Frequency<T>) -> Self::Output {
6064 TimePerDistance{spm: self.per_m / rhs.Hz.clone()}
6065 }
6066}
6067impl<T> core::ops::Div<&Frequency<T>> for &InverseDistance<T> where T: NumLike {
6069 type Output = TimePerDistance<T>;
6070 fn div(self, rhs: &Frequency<T>) -> Self::Output {
6071 TimePerDistance{spm: self.per_m.clone() / rhs.Hz.clone()}
6072 }
6073}
6074
6075impl<T> core::ops::Div<InverseEnergy<T>> for InverseDistance<T> where T: NumLike {
6078 type Output = Force<T>;
6079 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
6080 Force{N: self.per_m / rhs.per_J}
6081 }
6082}
6083impl<T> core::ops::Div<InverseEnergy<T>> for &InverseDistance<T> where T: NumLike {
6085 type Output = Force<T>;
6086 fn div(self, rhs: InverseEnergy<T>) -> Self::Output {
6087 Force{N: self.per_m.clone() / rhs.per_J}
6088 }
6089}
6090impl<T> core::ops::Div<&InverseEnergy<T>> for InverseDistance<T> where T: NumLike {
6092 type Output = Force<T>;
6093 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
6094 Force{N: self.per_m / rhs.per_J.clone()}
6095 }
6096}
6097impl<T> core::ops::Div<&InverseEnergy<T>> for &InverseDistance<T> where T: NumLike {
6099 type Output = Force<T>;
6100 fn div(self, rhs: &InverseEnergy<T>) -> Self::Output {
6101 Force{N: self.per_m.clone() / rhs.per_J.clone()}
6102 }
6103}
6104
6105impl<T> core::ops::Div<InverseTorque<T>> for InverseDistance<T> where T: NumLike {
6108 type Output = Force<T>;
6109 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
6110 Force{N: self.per_m / rhs.per_Nm}
6111 }
6112}
6113impl<T> core::ops::Div<InverseTorque<T>> for &InverseDistance<T> where T: NumLike {
6115 type Output = Force<T>;
6116 fn div(self, rhs: InverseTorque<T>) -> Self::Output {
6117 Force{N: self.per_m.clone() / rhs.per_Nm}
6118 }
6119}
6120impl<T> core::ops::Div<&InverseTorque<T>> for InverseDistance<T> where T: NumLike {
6122 type Output = Force<T>;
6123 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
6124 Force{N: self.per_m / rhs.per_Nm.clone()}
6125 }
6126}
6127impl<T> core::ops::Div<&InverseTorque<T>> for &InverseDistance<T> where T: NumLike {
6129 type Output = Force<T>;
6130 fn div(self, rhs: &InverseTorque<T>) -> Self::Output {
6131 Force{N: self.per_m.clone() / rhs.per_Nm.clone()}
6132 }
6133}
6134
6135impl<T> core::ops::Mul<InverseForce<T>> for InverseDistance<T> where T: NumLike {
6138 type Output = InverseEnergy<T>;
6139 fn mul(self, rhs: InverseForce<T>) -> Self::Output {
6140 InverseEnergy{per_J: self.per_m * rhs.per_N}
6141 }
6142}
6143impl<T> core::ops::Mul<InverseForce<T>> for &InverseDistance<T> where T: NumLike {
6145 type Output = InverseEnergy<T>;
6146 fn mul(self, rhs: InverseForce<T>) -> Self::Output {
6147 InverseEnergy{per_J: self.per_m.clone() * rhs.per_N}
6148 }
6149}
6150impl<T> core::ops::Mul<&InverseForce<T>> for InverseDistance<T> where T: NumLike {
6152 type Output = InverseEnergy<T>;
6153 fn mul(self, rhs: &InverseForce<T>) -> Self::Output {
6154 InverseEnergy{per_J: self.per_m * rhs.per_N.clone()}
6155 }
6156}
6157impl<T> core::ops::Mul<&InverseForce<T>> for &InverseDistance<T> where T: NumLike {
6159 type Output = InverseEnergy<T>;
6160 fn mul(self, rhs: &InverseForce<T>) -> Self::Output {
6161 InverseEnergy{per_J: self.per_m.clone() * rhs.per_N.clone()}
6162 }
6163}
6164
6165impl<T> core::ops::Div<TimePerDistance<T>> for InverseDistance<T> where T: NumLike {
6168 type Output = Frequency<T>;
6169 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
6170 Frequency{Hz: self.per_m / rhs.spm}
6171 }
6172}
6173impl<T> core::ops::Div<TimePerDistance<T>> for &InverseDistance<T> where T: NumLike {
6175 type Output = Frequency<T>;
6176 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
6177 Frequency{Hz: self.per_m.clone() / rhs.spm}
6178 }
6179}
6180impl<T> core::ops::Div<&TimePerDistance<T>> for InverseDistance<T> where T: NumLike {
6182 type Output = Frequency<T>;
6183 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
6184 Frequency{Hz: self.per_m / rhs.spm.clone()}
6185 }
6186}
6187impl<T> core::ops::Div<&TimePerDistance<T>> for &InverseDistance<T> where T: NumLike {
6189 type Output = Frequency<T>;
6190 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
6191 Frequency{Hz: self.per_m.clone() / rhs.spm.clone()}
6192 }
6193}
6194
6195impl<T> core::ops::Mul<Velocity<T>> for InverseDistance<T> where T: NumLike {
6198 type Output = Frequency<T>;
6199 fn mul(self, rhs: Velocity<T>) -> Self::Output {
6200 Frequency{Hz: self.per_m * rhs.mps}
6201 }
6202}
6203impl<T> core::ops::Mul<Velocity<T>> for &InverseDistance<T> where T: NumLike {
6205 type Output = Frequency<T>;
6206 fn mul(self, rhs: Velocity<T>) -> Self::Output {
6207 Frequency{Hz: self.per_m.clone() * rhs.mps}
6208 }
6209}
6210impl<T> core::ops::Mul<&Velocity<T>> for InverseDistance<T> where T: NumLike {
6212 type Output = Frequency<T>;
6213 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
6214 Frequency{Hz: self.per_m * rhs.mps.clone()}
6215 }
6216}
6217impl<T> core::ops::Mul<&Velocity<T>> for &InverseDistance<T> where T: NumLike {
6219 type Output = Frequency<T>;
6220 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
6221 Frequency{Hz: self.per_m.clone() * rhs.mps.clone()}
6222 }
6223}
6224
6225impl<T> core::ops::Mul<VolumePerMass<T>> for InverseDistance<T> where T: NumLike {
6228 type Output = AreaPerMass<T>;
6229 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
6230 AreaPerMass{m2_per_kg: self.per_m * rhs.m3_per_kg}
6231 }
6232}
6233impl<T> core::ops::Mul<VolumePerMass<T>> for &InverseDistance<T> where T: NumLike {
6235 type Output = AreaPerMass<T>;
6236 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
6237 AreaPerMass{m2_per_kg: self.per_m.clone() * rhs.m3_per_kg}
6238 }
6239}
6240impl<T> core::ops::Mul<&VolumePerMass<T>> for InverseDistance<T> where T: NumLike {
6242 type Output = AreaPerMass<T>;
6243 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
6244 AreaPerMass{m2_per_kg: self.per_m * rhs.m3_per_kg.clone()}
6245 }
6246}
6247impl<T> core::ops::Mul<&VolumePerMass<T>> for &InverseDistance<T> where T: NumLike {
6249 type Output = AreaPerMass<T>;
6250 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
6251 AreaPerMass{m2_per_kg: self.per_m.clone() * rhs.m3_per_kg.clone()}
6252 }
6253}
6254
6255impl<T> core::ops::Div<InverseAbsorbedDose<T>> for InverseDistance<T> where T: NumLike {
6258 type Output = Acceleration<T>;
6259 fn div(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
6260 Acceleration{mps2: self.per_m / rhs.per_Gy}
6261 }
6262}
6263impl<T> core::ops::Div<InverseAbsorbedDose<T>> for &InverseDistance<T> where T: NumLike {
6265 type Output = Acceleration<T>;
6266 fn div(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
6267 Acceleration{mps2: self.per_m.clone() / rhs.per_Gy}
6268 }
6269}
6270impl<T> core::ops::Div<&InverseAbsorbedDose<T>> for InverseDistance<T> where T: NumLike {
6272 type Output = Acceleration<T>;
6273 fn div(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
6274 Acceleration{mps2: self.per_m / rhs.per_Gy.clone()}
6275 }
6276}
6277impl<T> core::ops::Div<&InverseAbsorbedDose<T>> for &InverseDistance<T> where T: NumLike {
6279 type Output = Acceleration<T>;
6280 fn div(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
6281 Acceleration{mps2: self.per_m.clone() / rhs.per_Gy.clone()}
6282 }
6283}
6284
6285impl<T> core::ops::Div<InverseDoseEquivalent<T>> for InverseDistance<T> where T: NumLike {
6288 type Output = Acceleration<T>;
6289 fn div(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
6290 Acceleration{mps2: self.per_m / rhs.per_Sv}
6291 }
6292}
6293impl<T> core::ops::Div<InverseDoseEquivalent<T>> for &InverseDistance<T> where T: NumLike {
6295 type Output = Acceleration<T>;
6296 fn div(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
6297 Acceleration{mps2: self.per_m.clone() / rhs.per_Sv}
6298 }
6299}
6300impl<T> core::ops::Div<&InverseDoseEquivalent<T>> for InverseDistance<T> where T: NumLike {
6302 type Output = Acceleration<T>;
6303 fn div(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
6304 Acceleration{mps2: self.per_m / rhs.per_Sv.clone()}
6305 }
6306}
6307impl<T> core::ops::Div<&InverseDoseEquivalent<T>> for &InverseDistance<T> where T: NumLike {
6309 type Output = Acceleration<T>;
6310 fn div(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
6311 Acceleration{mps2: self.per_m.clone() / rhs.per_Sv.clone()}
6312 }
6313}
6314
6315impl<T> core::ops::Div<InverseDistance<T>> for f64 where T: NumLike+From<f64> {
6318 type Output = Distance<T>;
6319 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6320 Distance{m: T::from(self) / rhs.per_m}
6321 }
6322}
6323impl<T> core::ops::Div<InverseDistance<T>> for &f64 where T: NumLike+From<f64> {
6325 type Output = Distance<T>;
6326 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6327 Distance{m: T::from(self.clone()) / rhs.per_m}
6328 }
6329}
6330impl<T> core::ops::Div<&InverseDistance<T>> for f64 where T: NumLike+From<f64> {
6332 type Output = Distance<T>;
6333 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6334 Distance{m: T::from(self) / rhs.per_m.clone()}
6335 }
6336}
6337impl<T> core::ops::Div<&InverseDistance<T>> for &f64 where T: NumLike+From<f64> {
6339 type Output = Distance<T>;
6340 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6341 Distance{m: T::from(self.clone()) / rhs.per_m.clone()}
6342 }
6343}
6344
6345impl<T> core::ops::Div<InverseDistance<T>> for f32 where T: NumLike+From<f32> {
6348 type Output = Distance<T>;
6349 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6350 Distance{m: T::from(self) / rhs.per_m}
6351 }
6352}
6353impl<T> core::ops::Div<InverseDistance<T>> for &f32 where T: NumLike+From<f32> {
6355 type Output = Distance<T>;
6356 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6357 Distance{m: T::from(self.clone()) / rhs.per_m}
6358 }
6359}
6360impl<T> core::ops::Div<&InverseDistance<T>> for f32 where T: NumLike+From<f32> {
6362 type Output = Distance<T>;
6363 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6364 Distance{m: T::from(self) / rhs.per_m.clone()}
6365 }
6366}
6367impl<T> core::ops::Div<&InverseDistance<T>> for &f32 where T: NumLike+From<f32> {
6369 type Output = Distance<T>;
6370 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6371 Distance{m: T::from(self.clone()) / rhs.per_m.clone()}
6372 }
6373}
6374
6375impl<T> core::ops::Div<InverseDistance<T>> for i64 where T: NumLike+From<i64> {
6378 type Output = Distance<T>;
6379 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6380 Distance{m: T::from(self) / rhs.per_m}
6381 }
6382}
6383impl<T> core::ops::Div<InverseDistance<T>> for &i64 where T: NumLike+From<i64> {
6385 type Output = Distance<T>;
6386 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6387 Distance{m: T::from(self.clone()) / rhs.per_m}
6388 }
6389}
6390impl<T> core::ops::Div<&InverseDistance<T>> for i64 where T: NumLike+From<i64> {
6392 type Output = Distance<T>;
6393 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6394 Distance{m: T::from(self) / rhs.per_m.clone()}
6395 }
6396}
6397impl<T> core::ops::Div<&InverseDistance<T>> for &i64 where T: NumLike+From<i64> {
6399 type Output = Distance<T>;
6400 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6401 Distance{m: T::from(self.clone()) / rhs.per_m.clone()}
6402 }
6403}
6404
6405impl<T> core::ops::Div<InverseDistance<T>> for i32 where T: NumLike+From<i32> {
6408 type Output = Distance<T>;
6409 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6410 Distance{m: T::from(self) / rhs.per_m}
6411 }
6412}
6413impl<T> core::ops::Div<InverseDistance<T>> for &i32 where T: NumLike+From<i32> {
6415 type Output = Distance<T>;
6416 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6417 Distance{m: T::from(self.clone()) / rhs.per_m}
6418 }
6419}
6420impl<T> core::ops::Div<&InverseDistance<T>> for i32 where T: NumLike+From<i32> {
6422 type Output = Distance<T>;
6423 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6424 Distance{m: T::from(self) / rhs.per_m.clone()}
6425 }
6426}
6427impl<T> core::ops::Div<&InverseDistance<T>> for &i32 where T: NumLike+From<i32> {
6429 type Output = Distance<T>;
6430 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6431 Distance{m: T::from(self.clone()) / rhs.per_m.clone()}
6432 }
6433}
6434
6435#[cfg(feature="num-bigfloat")]
6438impl<T> core::ops::Div<InverseDistance<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
6439 type Output = Distance<T>;
6440 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6441 Distance{m: T::from(self) / rhs.per_m}
6442 }
6443}
6444#[cfg(feature="num-bigfloat")]
6446impl<T> core::ops::Div<InverseDistance<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
6447 type Output = Distance<T>;
6448 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6449 Distance{m: T::from(self.clone()) / rhs.per_m}
6450 }
6451}
6452#[cfg(feature="num-bigfloat")]
6454impl<T> core::ops::Div<&InverseDistance<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
6455 type Output = Distance<T>;
6456 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6457 Distance{m: T::from(self) / rhs.per_m.clone()}
6458 }
6459}
6460#[cfg(feature="num-bigfloat")]
6462impl<T> core::ops::Div<&InverseDistance<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
6463 type Output = Distance<T>;
6464 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6465 Distance{m: T::from(self.clone()) / rhs.per_m.clone()}
6466 }
6467}
6468
6469#[cfg(feature="num-complex")]
6472impl<T> core::ops::Div<InverseDistance<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
6473 type Output = Distance<T>;
6474 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6475 Distance{m: T::from(self) / rhs.per_m}
6476 }
6477}
6478#[cfg(feature="num-complex")]
6480impl<T> core::ops::Div<InverseDistance<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
6481 type Output = Distance<T>;
6482 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6483 Distance{m: T::from(self.clone()) / rhs.per_m}
6484 }
6485}
6486#[cfg(feature="num-complex")]
6488impl<T> core::ops::Div<&InverseDistance<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
6489 type Output = Distance<T>;
6490 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6491 Distance{m: T::from(self) / rhs.per_m.clone()}
6492 }
6493}
6494#[cfg(feature="num-complex")]
6496impl<T> core::ops::Div<&InverseDistance<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
6497 type Output = Distance<T>;
6498 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6499 Distance{m: T::from(self.clone()) / rhs.per_m.clone()}
6500 }
6501}
6502
6503#[cfg(feature="num-complex")]
6506impl<T> core::ops::Div<InverseDistance<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
6507 type Output = Distance<T>;
6508 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6509 Distance{m: T::from(self) / rhs.per_m}
6510 }
6511}
6512#[cfg(feature="num-complex")]
6514impl<T> core::ops::Div<InverseDistance<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
6515 type Output = Distance<T>;
6516 fn div(self, rhs: InverseDistance<T>) -> Self::Output {
6517 Distance{m: T::from(self.clone()) / rhs.per_m}
6518 }
6519}
6520#[cfg(feature="num-complex")]
6522impl<T> core::ops::Div<&InverseDistance<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
6523 type Output = Distance<T>;
6524 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6525 Distance{m: T::from(self) / rhs.per_m.clone()}
6526 }
6527}
6528#[cfg(feature="num-complex")]
6530impl<T> core::ops::Div<&InverseDistance<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
6531 type Output = Distance<T>;
6532 fn div(self, rhs: &InverseDistance<T>) -> Self::Output {
6533 Distance{m: T::from(self.clone()) / rhs.per_m.clone()}
6534 }
6535}
6536
6537#[derive(UnitStruct, Debug, Clone)]
6539#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
6540pub struct InverseLuminosity<T: NumLike>{
6541 pub per_cd: T
6543}
6544
6545impl<T> InverseLuminosity<T> where T: NumLike {
6546
6547 pub fn unit_name() -> &'static str { "inverse candela" }
6549
6550 pub fn unit_symbol() -> &'static str { "1/cd" }
6552
6553 pub fn from_per_cd(per_cd: T) -> Self { InverseLuminosity{per_cd: per_cd} }
6558
6559 pub fn to_per_cd(&self) -> T { self.per_cd.clone() }
6561
6562 pub fn from_per_candela(per_candela: T) -> Self { InverseLuminosity{per_cd: per_candela} }
6567
6568 pub fn to_per_candela(&self) -> T { self.per_cd.clone() }
6570
6571}
6572
6573impl<T> fmt::Display for InverseLuminosity<T> where T: NumLike {
6574 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6575 write!(f, "{} {}", &self.per_cd, Self::unit_symbol())
6576 }
6577}
6578
6579impl<T> InverseLuminosity<T> where T: NumLike+From<f64> {
6580
6581 pub fn to_per_mcd(&self) -> T {
6585 return self.per_cd.clone() * T::from(0.001_f64);
6586 }
6587
6588 pub fn from_per_mcd(per_mcd: T) -> Self {
6595 InverseLuminosity{per_cd: per_mcd * T::from(1000.0_f64)}
6596 }
6597
6598 pub fn to_per_ucd(&self) -> T {
6602 return self.per_cd.clone() * T::from(1e-06_f64);
6603 }
6604
6605 pub fn from_per_ucd(per_ucd: T) -> Self {
6612 InverseLuminosity{per_cd: per_ucd * T::from(1000000.0_f64)}
6613 }
6614
6615 pub fn to_per_ncd(&self) -> T {
6619 return self.per_cd.clone() * T::from(1e-09_f64);
6620 }
6621
6622 pub fn from_per_ncd(per_ncd: T) -> Self {
6629 InverseLuminosity{per_cd: per_ncd * T::from(1000000000.0_f64)}
6630 }
6631
6632 pub fn to_per_kcd(&self) -> T {
6636 return self.per_cd.clone() * T::from(1000.0_f64);
6637 }
6638
6639 pub fn from_per_kcd(per_kcd: T) -> Self {
6646 InverseLuminosity{per_cd: per_kcd * T::from(0.001_f64)}
6647 }
6648
6649 pub fn to_per_Mcd(&self) -> T {
6653 return self.per_cd.clone() * T::from(1000000.0_f64);
6654 }
6655
6656 pub fn from_per_Mcd(per_Mcd: T) -> Self {
6663 InverseLuminosity{per_cd: per_Mcd * T::from(1e-06_f64)}
6664 }
6665
6666 pub fn to_per_Gcd(&self) -> T {
6670 return self.per_cd.clone() * T::from(1000000000.0_f64);
6671 }
6672
6673 pub fn from_per_Gcd(per_Gcd: T) -> Self {
6680 InverseLuminosity{per_cd: per_Gcd * T::from(1e-09_f64)}
6681 }
6682
6683}
6684
6685
6686#[cfg(feature="num-bigfloat")]
6688impl core::ops::Mul<InverseLuminosity<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
6689 type Output = InverseLuminosity<num_bigfloat::BigFloat>;
6690 fn mul(self, rhs: InverseLuminosity<num_bigfloat::BigFloat>) -> Self::Output {
6691 InverseLuminosity{per_cd: self * rhs.per_cd}
6692 }
6693}
6694#[cfg(feature="num-bigfloat")]
6696impl core::ops::Mul<InverseLuminosity<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
6697 type Output = InverseLuminosity<num_bigfloat::BigFloat>;
6698 fn mul(self, rhs: InverseLuminosity<num_bigfloat::BigFloat>) -> Self::Output {
6699 InverseLuminosity{per_cd: self.clone() * rhs.per_cd}
6700 }
6701}
6702#[cfg(feature="num-bigfloat")]
6704impl core::ops::Mul<&InverseLuminosity<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
6705 type Output = InverseLuminosity<num_bigfloat::BigFloat>;
6706 fn mul(self, rhs: &InverseLuminosity<num_bigfloat::BigFloat>) -> Self::Output {
6707 InverseLuminosity{per_cd: self * rhs.per_cd.clone()}
6708 }
6709}
6710#[cfg(feature="num-bigfloat")]
6712impl core::ops::Mul<&InverseLuminosity<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
6713 type Output = InverseLuminosity<num_bigfloat::BigFloat>;
6714 fn mul(self, rhs: &InverseLuminosity<num_bigfloat::BigFloat>) -> Self::Output {
6715 InverseLuminosity{per_cd: self.clone() * rhs.per_cd.clone()}
6716 }
6717}
6718
6719#[cfg(feature="num-complex")]
6721impl core::ops::Mul<InverseLuminosity<num_complex::Complex32>> for num_complex::Complex32 {
6722 type Output = InverseLuminosity<num_complex::Complex32>;
6723 fn mul(self, rhs: InverseLuminosity<num_complex::Complex32>) -> Self::Output {
6724 InverseLuminosity{per_cd: self * rhs.per_cd}
6725 }
6726}
6727#[cfg(feature="num-complex")]
6729impl core::ops::Mul<InverseLuminosity<num_complex::Complex32>> for &num_complex::Complex32 {
6730 type Output = InverseLuminosity<num_complex::Complex32>;
6731 fn mul(self, rhs: InverseLuminosity<num_complex::Complex32>) -> Self::Output {
6732 InverseLuminosity{per_cd: self.clone() * rhs.per_cd}
6733 }
6734}
6735#[cfg(feature="num-complex")]
6737impl core::ops::Mul<&InverseLuminosity<num_complex::Complex32>> for num_complex::Complex32 {
6738 type Output = InverseLuminosity<num_complex::Complex32>;
6739 fn mul(self, rhs: &InverseLuminosity<num_complex::Complex32>) -> Self::Output {
6740 InverseLuminosity{per_cd: self * rhs.per_cd.clone()}
6741 }
6742}
6743#[cfg(feature="num-complex")]
6745impl core::ops::Mul<&InverseLuminosity<num_complex::Complex32>> for &num_complex::Complex32 {
6746 type Output = InverseLuminosity<num_complex::Complex32>;
6747 fn mul(self, rhs: &InverseLuminosity<num_complex::Complex32>) -> Self::Output {
6748 InverseLuminosity{per_cd: self.clone() * rhs.per_cd.clone()}
6749 }
6750}
6751
6752#[cfg(feature="num-complex")]
6754impl core::ops::Mul<InverseLuminosity<num_complex::Complex64>> for num_complex::Complex64 {
6755 type Output = InverseLuminosity<num_complex::Complex64>;
6756 fn mul(self, rhs: InverseLuminosity<num_complex::Complex64>) -> Self::Output {
6757 InverseLuminosity{per_cd: self * rhs.per_cd}
6758 }
6759}
6760#[cfg(feature="num-complex")]
6762impl core::ops::Mul<InverseLuminosity<num_complex::Complex64>> for &num_complex::Complex64 {
6763 type Output = InverseLuminosity<num_complex::Complex64>;
6764 fn mul(self, rhs: InverseLuminosity<num_complex::Complex64>) -> Self::Output {
6765 InverseLuminosity{per_cd: self.clone() * rhs.per_cd}
6766 }
6767}
6768#[cfg(feature="num-complex")]
6770impl core::ops::Mul<&InverseLuminosity<num_complex::Complex64>> for num_complex::Complex64 {
6771 type Output = InverseLuminosity<num_complex::Complex64>;
6772 fn mul(self, rhs: &InverseLuminosity<num_complex::Complex64>) -> Self::Output {
6773 InverseLuminosity{per_cd: self * rhs.per_cd.clone()}
6774 }
6775}
6776#[cfg(feature="num-complex")]
6778impl core::ops::Mul<&InverseLuminosity<num_complex::Complex64>> for &num_complex::Complex64 {
6779 type Output = InverseLuminosity<num_complex::Complex64>;
6780 fn mul(self, rhs: &InverseLuminosity<num_complex::Complex64>) -> Self::Output {
6781 InverseLuminosity{per_cd: self.clone() * rhs.per_cd.clone()}
6782 }
6783}
6784
6785
6786
6787
6788impl<T> core::ops::Div<InverseLuminousFlux<T>> for InverseLuminosity<T> where T: NumLike {
6791 type Output = SolidAngle<T>;
6792 fn div(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
6793 SolidAngle{sr: self.per_cd / rhs.per_lm}
6794 }
6795}
6796impl<T> core::ops::Div<InverseLuminousFlux<T>> for &InverseLuminosity<T> where T: NumLike {
6798 type Output = SolidAngle<T>;
6799 fn div(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
6800 SolidAngle{sr: self.per_cd.clone() / rhs.per_lm}
6801 }
6802}
6803impl<T> core::ops::Div<&InverseLuminousFlux<T>> for InverseLuminosity<T> where T: NumLike {
6805 type Output = SolidAngle<T>;
6806 fn div(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
6807 SolidAngle{sr: self.per_cd / rhs.per_lm.clone()}
6808 }
6809}
6810impl<T> core::ops::Div<&InverseLuminousFlux<T>> for &InverseLuminosity<T> where T: NumLike {
6812 type Output = SolidAngle<T>;
6813 fn div(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
6814 SolidAngle{sr: self.per_cd.clone() / rhs.per_lm.clone()}
6815 }
6816}
6817
6818impl<T> core::ops::Mul<LuminousFlux<T>> for InverseLuminosity<T> where T: NumLike {
6821 type Output = SolidAngle<T>;
6822 fn mul(self, rhs: LuminousFlux<T>) -> Self::Output {
6823 SolidAngle{sr: self.per_cd * rhs.lm}
6824 }
6825}
6826impl<T> core::ops::Mul<LuminousFlux<T>> for &InverseLuminosity<T> where T: NumLike {
6828 type Output = SolidAngle<T>;
6829 fn mul(self, rhs: LuminousFlux<T>) -> Self::Output {
6830 SolidAngle{sr: self.per_cd.clone() * rhs.lm}
6831 }
6832}
6833impl<T> core::ops::Mul<&LuminousFlux<T>> for InverseLuminosity<T> where T: NumLike {
6835 type Output = SolidAngle<T>;
6836 fn mul(self, rhs: &LuminousFlux<T>) -> Self::Output {
6837 SolidAngle{sr: self.per_cd * rhs.lm.clone()}
6838 }
6839}
6840impl<T> core::ops::Mul<&LuminousFlux<T>> for &InverseLuminosity<T> where T: NumLike {
6842 type Output = SolidAngle<T>;
6843 fn mul(self, rhs: &LuminousFlux<T>) -> Self::Output {
6844 SolidAngle{sr: self.per_cd.clone() * rhs.lm.clone()}
6845 }
6846}
6847
6848impl<T> core::ops::Mul<InverseSolidAngle<T>> for InverseLuminosity<T> where T: NumLike {
6851 type Output = InverseLuminousFlux<T>;
6852 fn mul(self, rhs: InverseSolidAngle<T>) -> Self::Output {
6853 InverseLuminousFlux{per_lm: self.per_cd * rhs.per_sr}
6854 }
6855}
6856impl<T> core::ops::Mul<InverseSolidAngle<T>> for &InverseLuminosity<T> where T: NumLike {
6858 type Output = InverseLuminousFlux<T>;
6859 fn mul(self, rhs: InverseSolidAngle<T>) -> Self::Output {
6860 InverseLuminousFlux{per_lm: self.per_cd.clone() * rhs.per_sr}
6861 }
6862}
6863impl<T> core::ops::Mul<&InverseSolidAngle<T>> for InverseLuminosity<T> where T: NumLike {
6865 type Output = InverseLuminousFlux<T>;
6866 fn mul(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
6867 InverseLuminousFlux{per_lm: self.per_cd * rhs.per_sr.clone()}
6868 }
6869}
6870impl<T> core::ops::Mul<&InverseSolidAngle<T>> for &InverseLuminosity<T> where T: NumLike {
6872 type Output = InverseLuminousFlux<T>;
6873 fn mul(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
6874 InverseLuminousFlux{per_lm: self.per_cd.clone() * rhs.per_sr.clone()}
6875 }
6876}
6877
6878impl<T> core::ops::Div<SolidAngle<T>> for InverseLuminosity<T> where T: NumLike {
6881 type Output = InverseLuminousFlux<T>;
6882 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
6883 InverseLuminousFlux{per_lm: self.per_cd / rhs.sr}
6884 }
6885}
6886impl<T> core::ops::Div<SolidAngle<T>> for &InverseLuminosity<T> where T: NumLike {
6888 type Output = InverseLuminousFlux<T>;
6889 fn div(self, rhs: SolidAngle<T>) -> Self::Output {
6890 InverseLuminousFlux{per_lm: self.per_cd.clone() / rhs.sr}
6891 }
6892}
6893impl<T> core::ops::Div<&SolidAngle<T>> for InverseLuminosity<T> where T: NumLike {
6895 type Output = InverseLuminousFlux<T>;
6896 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
6897 InverseLuminousFlux{per_lm: self.per_cd / rhs.sr.clone()}
6898 }
6899}
6900impl<T> core::ops::Div<&SolidAngle<T>> for &InverseLuminosity<T> where T: NumLike {
6902 type Output = InverseLuminousFlux<T>;
6903 fn div(self, rhs: &SolidAngle<T>) -> Self::Output {
6904 InverseLuminousFlux{per_lm: self.per_cd.clone() / rhs.sr.clone()}
6905 }
6906}
6907
6908impl<T> core::ops::Div<InverseLuminosity<T>> for f64 where T: NumLike+From<f64> {
6911 type Output = Luminosity<T>;
6912 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
6913 Luminosity{cd: T::from(self) / rhs.per_cd}
6914 }
6915}
6916impl<T> core::ops::Div<InverseLuminosity<T>> for &f64 where T: NumLike+From<f64> {
6918 type Output = Luminosity<T>;
6919 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
6920 Luminosity{cd: T::from(self.clone()) / rhs.per_cd}
6921 }
6922}
6923impl<T> core::ops::Div<&InverseLuminosity<T>> for f64 where T: NumLike+From<f64> {
6925 type Output = Luminosity<T>;
6926 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
6927 Luminosity{cd: T::from(self) / rhs.per_cd.clone()}
6928 }
6929}
6930impl<T> core::ops::Div<&InverseLuminosity<T>> for &f64 where T: NumLike+From<f64> {
6932 type Output = Luminosity<T>;
6933 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
6934 Luminosity{cd: T::from(self.clone()) / rhs.per_cd.clone()}
6935 }
6936}
6937
6938impl<T> core::ops::Div<InverseLuminosity<T>> for f32 where T: NumLike+From<f32> {
6941 type Output = Luminosity<T>;
6942 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
6943 Luminosity{cd: T::from(self) / rhs.per_cd}
6944 }
6945}
6946impl<T> core::ops::Div<InverseLuminosity<T>> for &f32 where T: NumLike+From<f32> {
6948 type Output = Luminosity<T>;
6949 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
6950 Luminosity{cd: T::from(self.clone()) / rhs.per_cd}
6951 }
6952}
6953impl<T> core::ops::Div<&InverseLuminosity<T>> for f32 where T: NumLike+From<f32> {
6955 type Output = Luminosity<T>;
6956 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
6957 Luminosity{cd: T::from(self) / rhs.per_cd.clone()}
6958 }
6959}
6960impl<T> core::ops::Div<&InverseLuminosity<T>> for &f32 where T: NumLike+From<f32> {
6962 type Output = Luminosity<T>;
6963 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
6964 Luminosity{cd: T::from(self.clone()) / rhs.per_cd.clone()}
6965 }
6966}
6967
6968impl<T> core::ops::Div<InverseLuminosity<T>> for i64 where T: NumLike+From<i64> {
6971 type Output = Luminosity<T>;
6972 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
6973 Luminosity{cd: T::from(self) / rhs.per_cd}
6974 }
6975}
6976impl<T> core::ops::Div<InverseLuminosity<T>> for &i64 where T: NumLike+From<i64> {
6978 type Output = Luminosity<T>;
6979 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
6980 Luminosity{cd: T::from(self.clone()) / rhs.per_cd}
6981 }
6982}
6983impl<T> core::ops::Div<&InverseLuminosity<T>> for i64 where T: NumLike+From<i64> {
6985 type Output = Luminosity<T>;
6986 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
6987 Luminosity{cd: T::from(self) / rhs.per_cd.clone()}
6988 }
6989}
6990impl<T> core::ops::Div<&InverseLuminosity<T>> for &i64 where T: NumLike+From<i64> {
6992 type Output = Luminosity<T>;
6993 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
6994 Luminosity{cd: T::from(self.clone()) / rhs.per_cd.clone()}
6995 }
6996}
6997
6998impl<T> core::ops::Div<InverseLuminosity<T>> for i32 where T: NumLike+From<i32> {
7001 type Output = Luminosity<T>;
7002 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
7003 Luminosity{cd: T::from(self) / rhs.per_cd}
7004 }
7005}
7006impl<T> core::ops::Div<InverseLuminosity<T>> for &i32 where T: NumLike+From<i32> {
7008 type Output = Luminosity<T>;
7009 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
7010 Luminosity{cd: T::from(self.clone()) / rhs.per_cd}
7011 }
7012}
7013impl<T> core::ops::Div<&InverseLuminosity<T>> for i32 where T: NumLike+From<i32> {
7015 type Output = Luminosity<T>;
7016 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
7017 Luminosity{cd: T::from(self) / rhs.per_cd.clone()}
7018 }
7019}
7020impl<T> core::ops::Div<&InverseLuminosity<T>> for &i32 where T: NumLike+From<i32> {
7022 type Output = Luminosity<T>;
7023 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
7024 Luminosity{cd: T::from(self.clone()) / rhs.per_cd.clone()}
7025 }
7026}
7027
7028#[cfg(feature="num-bigfloat")]
7031impl<T> core::ops::Div<InverseLuminosity<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
7032 type Output = Luminosity<T>;
7033 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
7034 Luminosity{cd: T::from(self) / rhs.per_cd}
7035 }
7036}
7037#[cfg(feature="num-bigfloat")]
7039impl<T> core::ops::Div<InverseLuminosity<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
7040 type Output = Luminosity<T>;
7041 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
7042 Luminosity{cd: T::from(self.clone()) / rhs.per_cd}
7043 }
7044}
7045#[cfg(feature="num-bigfloat")]
7047impl<T> core::ops::Div<&InverseLuminosity<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
7048 type Output = Luminosity<T>;
7049 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
7050 Luminosity{cd: T::from(self) / rhs.per_cd.clone()}
7051 }
7052}
7053#[cfg(feature="num-bigfloat")]
7055impl<T> core::ops::Div<&InverseLuminosity<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
7056 type Output = Luminosity<T>;
7057 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
7058 Luminosity{cd: T::from(self.clone()) / rhs.per_cd.clone()}
7059 }
7060}
7061
7062#[cfg(feature="num-complex")]
7065impl<T> core::ops::Div<InverseLuminosity<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
7066 type Output = Luminosity<T>;
7067 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
7068 Luminosity{cd: T::from(self) / rhs.per_cd}
7069 }
7070}
7071#[cfg(feature="num-complex")]
7073impl<T> core::ops::Div<InverseLuminosity<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
7074 type Output = Luminosity<T>;
7075 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
7076 Luminosity{cd: T::from(self.clone()) / rhs.per_cd}
7077 }
7078}
7079#[cfg(feature="num-complex")]
7081impl<T> core::ops::Div<&InverseLuminosity<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
7082 type Output = Luminosity<T>;
7083 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
7084 Luminosity{cd: T::from(self) / rhs.per_cd.clone()}
7085 }
7086}
7087#[cfg(feature="num-complex")]
7089impl<T> core::ops::Div<&InverseLuminosity<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
7090 type Output = Luminosity<T>;
7091 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
7092 Luminosity{cd: T::from(self.clone()) / rhs.per_cd.clone()}
7093 }
7094}
7095
7096#[cfg(feature="num-complex")]
7099impl<T> core::ops::Div<InverseLuminosity<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
7100 type Output = Luminosity<T>;
7101 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
7102 Luminosity{cd: T::from(self) / rhs.per_cd}
7103 }
7104}
7105#[cfg(feature="num-complex")]
7107impl<T> core::ops::Div<InverseLuminosity<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
7108 type Output = Luminosity<T>;
7109 fn div(self, rhs: InverseLuminosity<T>) -> Self::Output {
7110 Luminosity{cd: T::from(self.clone()) / rhs.per_cd}
7111 }
7112}
7113#[cfg(feature="num-complex")]
7115impl<T> core::ops::Div<&InverseLuminosity<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
7116 type Output = Luminosity<T>;
7117 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
7118 Luminosity{cd: T::from(self) / rhs.per_cd.clone()}
7119 }
7120}
7121#[cfg(feature="num-complex")]
7123impl<T> core::ops::Div<&InverseLuminosity<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
7124 type Output = Luminosity<T>;
7125 fn div(self, rhs: &InverseLuminosity<T>) -> Self::Output {
7126 Luminosity{cd: T::from(self.clone()) / rhs.per_cd.clone()}
7127 }
7128}
7129
7130#[derive(UnitStruct, Debug, Clone)]
7132#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
7133pub struct InverseMass<T: NumLike>{
7134 pub per_kg: T
7136}
7137
7138impl<T> InverseMass<T> where T: NumLike {
7139
7140 pub fn unit_name() -> &'static str { "inverse kilograms" }
7142
7143 pub fn unit_symbol() -> &'static str { "1/kg" }
7145
7146 pub fn from_per_kg(per_kg: T) -> Self { InverseMass{per_kg: per_kg} }
7151
7152 pub fn to_per_kg(&self) -> T { self.per_kg.clone() }
7154
7155 pub fn from_per_kilograms(per_kilograms: T) -> Self { InverseMass{per_kg: per_kilograms} }
7160
7161 pub fn to_per_kilograms(&self) -> T { self.per_kg.clone() }
7163
7164}
7165
7166impl<T> fmt::Display for InverseMass<T> where T: NumLike {
7167 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7168 write!(f, "{} {}", &self.per_kg, Self::unit_symbol())
7169 }
7170}
7171
7172impl<T> InverseMass<T> where T: NumLike+From<f64> {
7173
7174 pub fn to_per_g(&self) -> T {
7178 return self.per_kg.clone() * T::from(0.001_f64);
7179 }
7180
7181 pub fn from_per_g(per_g: T) -> Self {
7188 InverseMass{per_kg: per_g * T::from(1000.0_f64)}
7189 }
7190
7191 pub fn to_per_mg(&self) -> T {
7195 return self.per_kg.clone() * T::from(1e-06_f64);
7196 }
7197
7198 pub fn from_per_mg(per_mg: T) -> Self {
7205 InverseMass{per_kg: per_mg * T::from(1000000.0_f64)}
7206 }
7207
7208 pub fn to_per_ug(&self) -> T {
7212 return self.per_kg.clone() * T::from(1e-09_f64);
7213 }
7214
7215 pub fn from_per_ug(per_ug: T) -> Self {
7222 InverseMass{per_kg: per_ug * T::from(1000000000.0_f64)}
7223 }
7224
7225 pub fn to_per_ng(&self) -> T {
7229 return self.per_kg.clone() * T::from(1e-12_f64);
7230 }
7231
7232 pub fn from_per_ng(per_ng: T) -> Self {
7239 InverseMass{per_kg: per_ng * T::from(1000000000000.0_f64)}
7240 }
7241
7242 pub fn to_per_pg(&self) -> T {
7246 return self.per_kg.clone() * T::from(1e-15_f64);
7247 }
7248
7249 pub fn from_per_pg(per_pg: T) -> Self {
7256 InverseMass{per_kg: per_pg * T::from(1000000000000000.0_f64)}
7257 }
7258
7259 pub fn to_per_tons(&self) -> T {
7263 return self.per_kg.clone() * T::from(1000.0_f64);
7264 }
7265
7266 pub fn from_per_tons(per_tons: T) -> Self {
7273 InverseMass{per_kg: per_tons * T::from(0.001_f64)}
7274 }
7275
7276 pub fn to_per_earth_mass(&self) -> T {
7280 return self.per_kg.clone() * T::from(5.97e+24_f64);
7281 }
7282
7283 pub fn from_per_earth_mass(per_earth_mass: T) -> Self {
7290 InverseMass{per_kg: per_earth_mass * T::from(1.6699999999999999e-25_f64)}
7291 }
7292
7293 pub fn to_per_jupiter_mass(&self) -> T {
7297 return self.per_kg.clone() * T::from(1.9e+27_f64);
7298 }
7299
7300 pub fn from_per_jupiter_mass(per_jupiter_mass: T) -> Self {
7307 InverseMass{per_kg: per_jupiter_mass * T::from(5.27e-28_f64)}
7308 }
7309
7310 pub fn to_per_solar_mass(&self) -> T {
7314 return self.per_kg.clone() * T::from(1.99e+30_f64);
7315 }
7316
7317 pub fn from_per_solar_mass(per_solar_mass: T) -> Self {
7324 InverseMass{per_kg: per_solar_mass * T::from(5.03e-31_f64)}
7325 }
7326
7327}
7328
7329
7330#[cfg(feature="num-bigfloat")]
7332impl core::ops::Mul<InverseMass<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
7333 type Output = InverseMass<num_bigfloat::BigFloat>;
7334 fn mul(self, rhs: InverseMass<num_bigfloat::BigFloat>) -> Self::Output {
7335 InverseMass{per_kg: self * rhs.per_kg}
7336 }
7337}
7338#[cfg(feature="num-bigfloat")]
7340impl core::ops::Mul<InverseMass<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
7341 type Output = InverseMass<num_bigfloat::BigFloat>;
7342 fn mul(self, rhs: InverseMass<num_bigfloat::BigFloat>) -> Self::Output {
7343 InverseMass{per_kg: self.clone() * rhs.per_kg}
7344 }
7345}
7346#[cfg(feature="num-bigfloat")]
7348impl core::ops::Mul<&InverseMass<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
7349 type Output = InverseMass<num_bigfloat::BigFloat>;
7350 fn mul(self, rhs: &InverseMass<num_bigfloat::BigFloat>) -> Self::Output {
7351 InverseMass{per_kg: self * rhs.per_kg.clone()}
7352 }
7353}
7354#[cfg(feature="num-bigfloat")]
7356impl core::ops::Mul<&InverseMass<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
7357 type Output = InverseMass<num_bigfloat::BigFloat>;
7358 fn mul(self, rhs: &InverseMass<num_bigfloat::BigFloat>) -> Self::Output {
7359 InverseMass{per_kg: self.clone() * rhs.per_kg.clone()}
7360 }
7361}
7362
7363#[cfg(feature="num-complex")]
7365impl core::ops::Mul<InverseMass<num_complex::Complex32>> for num_complex::Complex32 {
7366 type Output = InverseMass<num_complex::Complex32>;
7367 fn mul(self, rhs: InverseMass<num_complex::Complex32>) -> Self::Output {
7368 InverseMass{per_kg: self * rhs.per_kg}
7369 }
7370}
7371#[cfg(feature="num-complex")]
7373impl core::ops::Mul<InverseMass<num_complex::Complex32>> for &num_complex::Complex32 {
7374 type Output = InverseMass<num_complex::Complex32>;
7375 fn mul(self, rhs: InverseMass<num_complex::Complex32>) -> Self::Output {
7376 InverseMass{per_kg: self.clone() * rhs.per_kg}
7377 }
7378}
7379#[cfg(feature="num-complex")]
7381impl core::ops::Mul<&InverseMass<num_complex::Complex32>> for num_complex::Complex32 {
7382 type Output = InverseMass<num_complex::Complex32>;
7383 fn mul(self, rhs: &InverseMass<num_complex::Complex32>) -> Self::Output {
7384 InverseMass{per_kg: self * rhs.per_kg.clone()}
7385 }
7386}
7387#[cfg(feature="num-complex")]
7389impl core::ops::Mul<&InverseMass<num_complex::Complex32>> for &num_complex::Complex32 {
7390 type Output = InverseMass<num_complex::Complex32>;
7391 fn mul(self, rhs: &InverseMass<num_complex::Complex32>) -> Self::Output {
7392 InverseMass{per_kg: self.clone() * rhs.per_kg.clone()}
7393 }
7394}
7395
7396#[cfg(feature="num-complex")]
7398impl core::ops::Mul<InverseMass<num_complex::Complex64>> for num_complex::Complex64 {
7399 type Output = InverseMass<num_complex::Complex64>;
7400 fn mul(self, rhs: InverseMass<num_complex::Complex64>) -> Self::Output {
7401 InverseMass{per_kg: self * rhs.per_kg}
7402 }
7403}
7404#[cfg(feature="num-complex")]
7406impl core::ops::Mul<InverseMass<num_complex::Complex64>> for &num_complex::Complex64 {
7407 type Output = InverseMass<num_complex::Complex64>;
7408 fn mul(self, rhs: InverseMass<num_complex::Complex64>) -> Self::Output {
7409 InverseMass{per_kg: self.clone() * rhs.per_kg}
7410 }
7411}
7412#[cfg(feature="num-complex")]
7414impl core::ops::Mul<&InverseMass<num_complex::Complex64>> for num_complex::Complex64 {
7415 type Output = InverseMass<num_complex::Complex64>;
7416 fn mul(self, rhs: &InverseMass<num_complex::Complex64>) -> Self::Output {
7417 InverseMass{per_kg: self * rhs.per_kg.clone()}
7418 }
7419}
7420#[cfg(feature="num-complex")]
7422impl core::ops::Mul<&InverseMass<num_complex::Complex64>> for &num_complex::Complex64 {
7423 type Output = InverseMass<num_complex::Complex64>;
7424 fn mul(self, rhs: &InverseMass<num_complex::Complex64>) -> Self::Output {
7425 InverseMass{per_kg: self.clone() * rhs.per_kg.clone()}
7426 }
7427}
7428
7429
7430
7431
7432impl<T> core::ops::Mul<Amount<T>> for InverseMass<T> where T: NumLike {
7435 type Output = Molality<T>;
7436 fn mul(self, rhs: Amount<T>) -> Self::Output {
7437 Molality{molpkg: self.per_kg * rhs.mol}
7438 }
7439}
7440impl<T> core::ops::Mul<Amount<T>> for &InverseMass<T> where T: NumLike {
7442 type Output = Molality<T>;
7443 fn mul(self, rhs: Amount<T>) -> Self::Output {
7444 Molality{molpkg: self.per_kg.clone() * rhs.mol}
7445 }
7446}
7447impl<T> core::ops::Mul<&Amount<T>> for InverseMass<T> where T: NumLike {
7449 type Output = Molality<T>;
7450 fn mul(self, rhs: &Amount<T>) -> Self::Output {
7451 Molality{molpkg: self.per_kg * rhs.mol.clone()}
7452 }
7453}
7454impl<T> core::ops::Mul<&Amount<T>> for &InverseMass<T> where T: NumLike {
7456 type Output = Molality<T>;
7457 fn mul(self, rhs: &Amount<T>) -> Self::Output {
7458 Molality{molpkg: self.per_kg.clone() * rhs.mol.clone()}
7459 }
7460}
7461
7462impl<T> core::ops::Div<InverseAmount<T>> for InverseMass<T> where T: NumLike {
7465 type Output = Molality<T>;
7466 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
7467 Molality{molpkg: self.per_kg / rhs.per_mol}
7468 }
7469}
7470impl<T> core::ops::Div<InverseAmount<T>> for &InverseMass<T> where T: NumLike {
7472 type Output = Molality<T>;
7473 fn div(self, rhs: InverseAmount<T>) -> Self::Output {
7474 Molality{molpkg: self.per_kg.clone() / rhs.per_mol}
7475 }
7476}
7477impl<T> core::ops::Div<&InverseAmount<T>> for InverseMass<T> where T: NumLike {
7479 type Output = Molality<T>;
7480 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
7481 Molality{molpkg: self.per_kg / rhs.per_mol.clone()}
7482 }
7483}
7484impl<T> core::ops::Div<&InverseAmount<T>> for &InverseMass<T> where T: NumLike {
7486 type Output = Molality<T>;
7487 fn div(self, rhs: &InverseAmount<T>) -> Self::Output {
7488 Molality{molpkg: self.per_kg.clone() / rhs.per_mol.clone()}
7489 }
7490}
7491
7492impl<T> core::ops::Div<Molality<T>> for InverseMass<T> where T: NumLike {
7495 type Output = InverseAmount<T>;
7496 fn div(self, rhs: Molality<T>) -> Self::Output {
7497 InverseAmount{per_mol: self.per_kg / rhs.molpkg}
7498 }
7499}
7500impl<T> core::ops::Div<Molality<T>> for &InverseMass<T> where T: NumLike {
7502 type Output = InverseAmount<T>;
7503 fn div(self, rhs: Molality<T>) -> Self::Output {
7504 InverseAmount{per_mol: self.per_kg.clone() / rhs.molpkg}
7505 }
7506}
7507impl<T> core::ops::Div<&Molality<T>> for InverseMass<T> where T: NumLike {
7509 type Output = InverseAmount<T>;
7510 fn div(self, rhs: &Molality<T>) -> Self::Output {
7511 InverseAmount{per_mol: self.per_kg / rhs.molpkg.clone()}
7512 }
7513}
7514impl<T> core::ops::Div<&Molality<T>> for &InverseMass<T> where T: NumLike {
7516 type Output = InverseAmount<T>;
7517 fn div(self, rhs: &Molality<T>) -> Self::Output {
7518 InverseAmount{per_mol: self.per_kg.clone() / rhs.molpkg.clone()}
7519 }
7520}
7521
7522impl<T> core::ops::Mul<MolarMass<T>> for InverseMass<T> where T: NumLike {
7525 type Output = InverseAmount<T>;
7526 fn mul(self, rhs: MolarMass<T>) -> Self::Output {
7527 InverseAmount{per_mol: self.per_kg * rhs.kgpmol}
7528 }
7529}
7530impl<T> core::ops::Mul<MolarMass<T>> for &InverseMass<T> where T: NumLike {
7532 type Output = InverseAmount<T>;
7533 fn mul(self, rhs: MolarMass<T>) -> Self::Output {
7534 InverseAmount{per_mol: self.per_kg.clone() * rhs.kgpmol}
7535 }
7536}
7537impl<T> core::ops::Mul<&MolarMass<T>> for InverseMass<T> where T: NumLike {
7539 type Output = InverseAmount<T>;
7540 fn mul(self, rhs: &MolarMass<T>) -> Self::Output {
7541 InverseAmount{per_mol: self.per_kg * rhs.kgpmol.clone()}
7542 }
7543}
7544impl<T> core::ops::Mul<&MolarMass<T>> for &InverseMass<T> where T: NumLike {
7546 type Output = InverseAmount<T>;
7547 fn mul(self, rhs: &MolarMass<T>) -> Self::Output {
7548 InverseAmount{per_mol: self.per_kg.clone() * rhs.kgpmol.clone()}
7549 }
7550}
7551
7552impl<T> core::ops::Mul<Area<T>> for InverseMass<T> where T: NumLike {
7555 type Output = AreaPerMass<T>;
7556 fn mul(self, rhs: Area<T>) -> Self::Output {
7557 AreaPerMass{m2_per_kg: self.per_kg * rhs.m2}
7558 }
7559}
7560impl<T> core::ops::Mul<Area<T>> for &InverseMass<T> where T: NumLike {
7562 type Output = AreaPerMass<T>;
7563 fn mul(self, rhs: Area<T>) -> Self::Output {
7564 AreaPerMass{m2_per_kg: self.per_kg.clone() * rhs.m2}
7565 }
7566}
7567impl<T> core::ops::Mul<&Area<T>> for InverseMass<T> where T: NumLike {
7569 type Output = AreaPerMass<T>;
7570 fn mul(self, rhs: &Area<T>) -> Self::Output {
7571 AreaPerMass{m2_per_kg: self.per_kg * rhs.m2.clone()}
7572 }
7573}
7574impl<T> core::ops::Mul<&Area<T>> for &InverseMass<T> where T: NumLike {
7576 type Output = AreaPerMass<T>;
7577 fn mul(self, rhs: &Area<T>) -> Self::Output {
7578 AreaPerMass{m2_per_kg: self.per_kg.clone() * rhs.m2.clone()}
7579 }
7580}
7581
7582impl<T> core::ops::Div<InverseArea<T>> for InverseMass<T> where T: NumLike {
7585 type Output = AreaPerMass<T>;
7586 fn div(self, rhs: InverseArea<T>) -> Self::Output {
7587 AreaPerMass{m2_per_kg: self.per_kg / rhs.per_m2}
7588 }
7589}
7590impl<T> core::ops::Div<InverseArea<T>> for &InverseMass<T> where T: NumLike {
7592 type Output = AreaPerMass<T>;
7593 fn div(self, rhs: InverseArea<T>) -> Self::Output {
7594 AreaPerMass{m2_per_kg: self.per_kg.clone() / rhs.per_m2}
7595 }
7596}
7597impl<T> core::ops::Div<&InverseArea<T>> for InverseMass<T> where T: NumLike {
7599 type Output = AreaPerMass<T>;
7600 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
7601 AreaPerMass{m2_per_kg: self.per_kg / rhs.per_m2.clone()}
7602 }
7603}
7604impl<T> core::ops::Div<&InverseArea<T>> for &InverseMass<T> where T: NumLike {
7606 type Output = AreaPerMass<T>;
7607 fn div(self, rhs: &InverseArea<T>) -> Self::Output {
7608 AreaPerMass{m2_per_kg: self.per_kg.clone() / rhs.per_m2.clone()}
7609 }
7610}
7611
7612impl<T> core::ops::Div<InverseVolume<T>> for InverseMass<T> where T: NumLike {
7615 type Output = VolumePerMass<T>;
7616 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
7617 VolumePerMass{m3_per_kg: self.per_kg / rhs.per_m3}
7618 }
7619}
7620impl<T> core::ops::Div<InverseVolume<T>> for &InverseMass<T> where T: NumLike {
7622 type Output = VolumePerMass<T>;
7623 fn div(self, rhs: InverseVolume<T>) -> Self::Output {
7624 VolumePerMass{m3_per_kg: self.per_kg.clone() / rhs.per_m3}
7625 }
7626}
7627impl<T> core::ops::Div<&InverseVolume<T>> for InverseMass<T> where T: NumLike {
7629 type Output = VolumePerMass<T>;
7630 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
7631 VolumePerMass{m3_per_kg: self.per_kg / rhs.per_m3.clone()}
7632 }
7633}
7634impl<T> core::ops::Div<&InverseVolume<T>> for &InverseMass<T> where T: NumLike {
7636 type Output = VolumePerMass<T>;
7637 fn div(self, rhs: &InverseVolume<T>) -> Self::Output {
7638 VolumePerMass{m3_per_kg: self.per_kg.clone() / rhs.per_m3.clone()}
7639 }
7640}
7641
7642impl<T> core::ops::Mul<Volume<T>> for InverseMass<T> where T: NumLike {
7645 type Output = VolumePerMass<T>;
7646 fn mul(self, rhs: Volume<T>) -> Self::Output {
7647 VolumePerMass{m3_per_kg: self.per_kg * rhs.m3}
7648 }
7649}
7650impl<T> core::ops::Mul<Volume<T>> for &InverseMass<T> where T: NumLike {
7652 type Output = VolumePerMass<T>;
7653 fn mul(self, rhs: Volume<T>) -> Self::Output {
7654 VolumePerMass{m3_per_kg: self.per_kg.clone() * rhs.m3}
7655 }
7656}
7657impl<T> core::ops::Mul<&Volume<T>> for InverseMass<T> where T: NumLike {
7659 type Output = VolumePerMass<T>;
7660 fn mul(self, rhs: &Volume<T>) -> Self::Output {
7661 VolumePerMass{m3_per_kg: self.per_kg * rhs.m3.clone()}
7662 }
7663}
7664impl<T> core::ops::Mul<&Volume<T>> for &InverseMass<T> where T: NumLike {
7666 type Output = VolumePerMass<T>;
7667 fn mul(self, rhs: &Volume<T>) -> Self::Output {
7668 VolumePerMass{m3_per_kg: self.per_kg.clone() * rhs.m3.clone()}
7669 }
7670}
7671
7672impl<T> core::ops::Div<Acceleration<T>> for InverseMass<T> where T: NumLike {
7675 type Output = InverseForce<T>;
7676 fn div(self, rhs: Acceleration<T>) -> Self::Output {
7677 InverseForce{per_N: self.per_kg / rhs.mps2}
7678 }
7679}
7680impl<T> core::ops::Div<Acceleration<T>> for &InverseMass<T> where T: NumLike {
7682 type Output = InverseForce<T>;
7683 fn div(self, rhs: Acceleration<T>) -> Self::Output {
7684 InverseForce{per_N: self.per_kg.clone() / rhs.mps2}
7685 }
7686}
7687impl<T> core::ops::Div<&Acceleration<T>> for InverseMass<T> where T: NumLike {
7689 type Output = InverseForce<T>;
7690 fn div(self, rhs: &Acceleration<T>) -> Self::Output {
7691 InverseForce{per_N: self.per_kg / rhs.mps2.clone()}
7692 }
7693}
7694impl<T> core::ops::Div<&Acceleration<T>> for &InverseMass<T> where T: NumLike {
7696 type Output = InverseForce<T>;
7697 fn div(self, rhs: &Acceleration<T>) -> Self::Output {
7698 InverseForce{per_N: self.per_kg.clone() / rhs.mps2.clone()}
7699 }
7700}
7701
7702impl<T> core::ops::Mul<AreaDensity<T>> for InverseMass<T> where T: NumLike {
7705 type Output = InverseArea<T>;
7706 fn mul(self, rhs: AreaDensity<T>) -> Self::Output {
7707 InverseArea{per_m2: self.per_kg * rhs.kgpm2}
7708 }
7709}
7710impl<T> core::ops::Mul<AreaDensity<T>> for &InverseMass<T> where T: NumLike {
7712 type Output = InverseArea<T>;
7713 fn mul(self, rhs: AreaDensity<T>) -> Self::Output {
7714 InverseArea{per_m2: self.per_kg.clone() * rhs.kgpm2}
7715 }
7716}
7717impl<T> core::ops::Mul<&AreaDensity<T>> for InverseMass<T> where T: NumLike {
7719 type Output = InverseArea<T>;
7720 fn mul(self, rhs: &AreaDensity<T>) -> Self::Output {
7721 InverseArea{per_m2: self.per_kg * rhs.kgpm2.clone()}
7722 }
7723}
7724impl<T> core::ops::Mul<&AreaDensity<T>> for &InverseMass<T> where T: NumLike {
7726 type Output = InverseArea<T>;
7727 fn mul(self, rhs: &AreaDensity<T>) -> Self::Output {
7728 InverseArea{per_m2: self.per_kg.clone() * rhs.kgpm2.clone()}
7729 }
7730}
7731
7732impl<T> core::ops::Div<AreaPerMass<T>> for InverseMass<T> where T: NumLike {
7735 type Output = InverseArea<T>;
7736 fn div(self, rhs: AreaPerMass<T>) -> Self::Output {
7737 InverseArea{per_m2: self.per_kg / rhs.m2_per_kg}
7738 }
7739}
7740impl<T> core::ops::Div<AreaPerMass<T>> for &InverseMass<T> where T: NumLike {
7742 type Output = InverseArea<T>;
7743 fn div(self, rhs: AreaPerMass<T>) -> Self::Output {
7744 InverseArea{per_m2: self.per_kg.clone() / rhs.m2_per_kg}
7745 }
7746}
7747impl<T> core::ops::Div<&AreaPerMass<T>> for InverseMass<T> where T: NumLike {
7749 type Output = InverseArea<T>;
7750 fn div(self, rhs: &AreaPerMass<T>) -> Self::Output {
7751 InverseArea{per_m2: self.per_kg / rhs.m2_per_kg.clone()}
7752 }
7753}
7754impl<T> core::ops::Div<&AreaPerMass<T>> for &InverseMass<T> where T: NumLike {
7756 type Output = InverseArea<T>;
7757 fn div(self, rhs: &AreaPerMass<T>) -> Self::Output {
7758 InverseArea{per_m2: self.per_kg.clone() / rhs.m2_per_kg.clone()}
7759 }
7760}
7761
7762impl<T> core::ops::Mul<Density<T>> for InverseMass<T> where T: NumLike {
7765 type Output = InverseVolume<T>;
7766 fn mul(self, rhs: Density<T>) -> Self::Output {
7767 InverseVolume{per_m3: self.per_kg * rhs.kgpm3}
7768 }
7769}
7770impl<T> core::ops::Mul<Density<T>> for &InverseMass<T> where T: NumLike {
7772 type Output = InverseVolume<T>;
7773 fn mul(self, rhs: Density<T>) -> Self::Output {
7774 InverseVolume{per_m3: self.per_kg.clone() * rhs.kgpm3}
7775 }
7776}
7777impl<T> core::ops::Mul<&Density<T>> for InverseMass<T> where T: NumLike {
7779 type Output = InverseVolume<T>;
7780 fn mul(self, rhs: &Density<T>) -> Self::Output {
7781 InverseVolume{per_m3: self.per_kg * rhs.kgpm3.clone()}
7782 }
7783}
7784impl<T> core::ops::Mul<&Density<T>> for &InverseMass<T> where T: NumLike {
7786 type Output = InverseVolume<T>;
7787 fn mul(self, rhs: &Density<T>) -> Self::Output {
7788 InverseVolume{per_m3: self.per_kg.clone() * rhs.kgpm3.clone()}
7789 }
7790}
7791
7792impl<T> core::ops::Mul<Force<T>> for InverseMass<T> where T: NumLike {
7795 type Output = Acceleration<T>;
7796 fn mul(self, rhs: Force<T>) -> Self::Output {
7797 Acceleration{mps2: self.per_kg * rhs.N}
7798 }
7799}
7800impl<T> core::ops::Mul<Force<T>> for &InverseMass<T> where T: NumLike {
7802 type Output = Acceleration<T>;
7803 fn mul(self, rhs: Force<T>) -> Self::Output {
7804 Acceleration{mps2: self.per_kg.clone() * rhs.N}
7805 }
7806}
7807impl<T> core::ops::Mul<&Force<T>> for InverseMass<T> where T: NumLike {
7809 type Output = Acceleration<T>;
7810 fn mul(self, rhs: &Force<T>) -> Self::Output {
7811 Acceleration{mps2: self.per_kg * rhs.N.clone()}
7812 }
7813}
7814impl<T> core::ops::Mul<&Force<T>> for &InverseMass<T> where T: NumLike {
7816 type Output = Acceleration<T>;
7817 fn mul(self, rhs: &Force<T>) -> Self::Output {
7818 Acceleration{mps2: self.per_kg.clone() * rhs.N.clone()}
7819 }
7820}
7821
7822impl<T> core::ops::Mul<InverseAcceleration<T>> for InverseMass<T> where T: NumLike {
7825 type Output = InverseForce<T>;
7826 fn mul(self, rhs: InverseAcceleration<T>) -> Self::Output {
7827 InverseForce{per_N: self.per_kg * rhs.s2pm}
7828 }
7829}
7830impl<T> core::ops::Mul<InverseAcceleration<T>> for &InverseMass<T> where T: NumLike {
7832 type Output = InverseForce<T>;
7833 fn mul(self, rhs: InverseAcceleration<T>) -> Self::Output {
7834 InverseForce{per_N: self.per_kg.clone() * rhs.s2pm}
7835 }
7836}
7837impl<T> core::ops::Mul<&InverseAcceleration<T>> for InverseMass<T> where T: NumLike {
7839 type Output = InverseForce<T>;
7840 fn mul(self, rhs: &InverseAcceleration<T>) -> Self::Output {
7841 InverseForce{per_N: self.per_kg * rhs.s2pm.clone()}
7842 }
7843}
7844impl<T> core::ops::Mul<&InverseAcceleration<T>> for &InverseMass<T> where T: NumLike {
7846 type Output = InverseForce<T>;
7847 fn mul(self, rhs: &InverseAcceleration<T>) -> Self::Output {
7848 InverseForce{per_N: self.per_kg.clone() * rhs.s2pm.clone()}
7849 }
7850}
7851
7852impl<T> core::ops::Div<InverseForce<T>> for InverseMass<T> where T: NumLike {
7855 type Output = Acceleration<T>;
7856 fn div(self, rhs: InverseForce<T>) -> Self::Output {
7857 Acceleration{mps2: self.per_kg / rhs.per_N}
7858 }
7859}
7860impl<T> core::ops::Div<InverseForce<T>> for &InverseMass<T> where T: NumLike {
7862 type Output = Acceleration<T>;
7863 fn div(self, rhs: InverseForce<T>) -> Self::Output {
7864 Acceleration{mps2: self.per_kg.clone() / rhs.per_N}
7865 }
7866}
7867impl<T> core::ops::Div<&InverseForce<T>> for InverseMass<T> where T: NumLike {
7869 type Output = Acceleration<T>;
7870 fn div(self, rhs: &InverseForce<T>) -> Self::Output {
7871 Acceleration{mps2: self.per_kg / rhs.per_N.clone()}
7872 }
7873}
7874impl<T> core::ops::Div<&InverseForce<T>> for &InverseMass<T> where T: NumLike {
7876 type Output = Acceleration<T>;
7877 fn div(self, rhs: &InverseForce<T>) -> Self::Output {
7878 Acceleration{mps2: self.per_kg.clone() / rhs.per_N.clone()}
7879 }
7880}
7881
7882impl<T> core::ops::Div<InverseMomentOfInertia<T>> for InverseMass<T> where T: NumLike {
7885 type Output = Area<T>;
7886 fn div(self, rhs: InverseMomentOfInertia<T>) -> Self::Output {
7887 Area{m2: self.per_kg / rhs.per_kgm2}
7888 }
7889}
7890impl<T> core::ops::Div<InverseMomentOfInertia<T>> for &InverseMass<T> where T: NumLike {
7892 type Output = Area<T>;
7893 fn div(self, rhs: InverseMomentOfInertia<T>) -> Self::Output {
7894 Area{m2: self.per_kg.clone() / rhs.per_kgm2}
7895 }
7896}
7897impl<T> core::ops::Div<&InverseMomentOfInertia<T>> for InverseMass<T> where T: NumLike {
7899 type Output = Area<T>;
7900 fn div(self, rhs: &InverseMomentOfInertia<T>) -> Self::Output {
7901 Area{m2: self.per_kg / rhs.per_kgm2.clone()}
7902 }
7903}
7904impl<T> core::ops::Div<&InverseMomentOfInertia<T>> for &InverseMass<T> where T: NumLike {
7906 type Output = Area<T>;
7907 fn div(self, rhs: &InverseMomentOfInertia<T>) -> Self::Output {
7908 Area{m2: self.per_kg.clone() / rhs.per_kgm2.clone()}
7909 }
7910}
7911
7912impl<T> core::ops::Div<InverseMomentum<T>> for InverseMass<T> where T: NumLike {
7915 type Output = Velocity<T>;
7916 fn div(self, rhs: InverseMomentum<T>) -> Self::Output {
7917 Velocity{mps: self.per_kg / rhs.s_per_kgm}
7918 }
7919}
7920impl<T> core::ops::Div<InverseMomentum<T>> for &InverseMass<T> where T: NumLike {
7922 type Output = Velocity<T>;
7923 fn div(self, rhs: InverseMomentum<T>) -> Self::Output {
7924 Velocity{mps: self.per_kg.clone() / rhs.s_per_kgm}
7925 }
7926}
7927impl<T> core::ops::Div<&InverseMomentum<T>> for InverseMass<T> where T: NumLike {
7929 type Output = Velocity<T>;
7930 fn div(self, rhs: &InverseMomentum<T>) -> Self::Output {
7931 Velocity{mps: self.per_kg / rhs.s_per_kgm.clone()}
7932 }
7933}
7934impl<T> core::ops::Div<&InverseMomentum<T>> for &InverseMass<T> where T: NumLike {
7936 type Output = Velocity<T>;
7937 fn div(self, rhs: &InverseMomentum<T>) -> Self::Output {
7938 Velocity{mps: self.per_kg.clone() / rhs.s_per_kgm.clone()}
7939 }
7940}
7941
7942impl<T> core::ops::Mul<MomentOfInertia<T>> for InverseMass<T> where T: NumLike {
7945 type Output = Area<T>;
7946 fn mul(self, rhs: MomentOfInertia<T>) -> Self::Output {
7947 Area{m2: self.per_kg * rhs.kgm2}
7948 }
7949}
7950impl<T> core::ops::Mul<MomentOfInertia<T>> for &InverseMass<T> where T: NumLike {
7952 type Output = Area<T>;
7953 fn mul(self, rhs: MomentOfInertia<T>) -> Self::Output {
7954 Area{m2: self.per_kg.clone() * rhs.kgm2}
7955 }
7956}
7957impl<T> core::ops::Mul<&MomentOfInertia<T>> for InverseMass<T> where T: NumLike {
7959 type Output = Area<T>;
7960 fn mul(self, rhs: &MomentOfInertia<T>) -> Self::Output {
7961 Area{m2: self.per_kg * rhs.kgm2.clone()}
7962 }
7963}
7964impl<T> core::ops::Mul<&MomentOfInertia<T>> for &InverseMass<T> where T: NumLike {
7966 type Output = Area<T>;
7967 fn mul(self, rhs: &MomentOfInertia<T>) -> Self::Output {
7968 Area{m2: self.per_kg.clone() * rhs.kgm2.clone()}
7969 }
7970}
7971
7972impl<T> core::ops::Mul<Momentum<T>> for InverseMass<T> where T: NumLike {
7975 type Output = Velocity<T>;
7976 fn mul(self, rhs: Momentum<T>) -> Self::Output {
7977 Velocity{mps: self.per_kg * rhs.kgmps}
7978 }
7979}
7980impl<T> core::ops::Mul<Momentum<T>> for &InverseMass<T> where T: NumLike {
7982 type Output = Velocity<T>;
7983 fn mul(self, rhs: Momentum<T>) -> Self::Output {
7984 Velocity{mps: self.per_kg.clone() * rhs.kgmps}
7985 }
7986}
7987impl<T> core::ops::Mul<&Momentum<T>> for InverseMass<T> where T: NumLike {
7989 type Output = Velocity<T>;
7990 fn mul(self, rhs: &Momentum<T>) -> Self::Output {
7991 Velocity{mps: self.per_kg * rhs.kgmps.clone()}
7992 }
7993}
7994impl<T> core::ops::Mul<&Momentum<T>> for &InverseMass<T> where T: NumLike {
7996 type Output = Velocity<T>;
7997 fn mul(self, rhs: &Momentum<T>) -> Self::Output {
7998 Velocity{mps: self.per_kg.clone() * rhs.kgmps.clone()}
7999 }
8000}
8001
8002impl<T> core::ops::Mul<TimePerDistance<T>> for InverseMass<T> where T: NumLike {
8005 type Output = InverseMomentum<T>;
8006 fn mul(self, rhs: TimePerDistance<T>) -> Self::Output {
8007 InverseMomentum{s_per_kgm: self.per_kg * rhs.spm}
8008 }
8009}
8010impl<T> core::ops::Mul<TimePerDistance<T>> for &InverseMass<T> where T: NumLike {
8012 type Output = InverseMomentum<T>;
8013 fn mul(self, rhs: TimePerDistance<T>) -> Self::Output {
8014 InverseMomentum{s_per_kgm: self.per_kg.clone() * rhs.spm}
8015 }
8016}
8017impl<T> core::ops::Mul<&TimePerDistance<T>> for InverseMass<T> where T: NumLike {
8019 type Output = InverseMomentum<T>;
8020 fn mul(self, rhs: &TimePerDistance<T>) -> Self::Output {
8021 InverseMomentum{s_per_kgm: self.per_kg * rhs.spm.clone()}
8022 }
8023}
8024impl<T> core::ops::Mul<&TimePerDistance<T>> for &InverseMass<T> where T: NumLike {
8026 type Output = InverseMomentum<T>;
8027 fn mul(self, rhs: &TimePerDistance<T>) -> Self::Output {
8028 InverseMomentum{s_per_kgm: self.per_kg.clone() * rhs.spm.clone()}
8029 }
8030}
8031
8032impl<T> core::ops::Div<Velocity<T>> for InverseMass<T> where T: NumLike {
8035 type Output = InverseMomentum<T>;
8036 fn div(self, rhs: Velocity<T>) -> Self::Output {
8037 InverseMomentum{s_per_kgm: self.per_kg / rhs.mps}
8038 }
8039}
8040impl<T> core::ops::Div<Velocity<T>> for &InverseMass<T> where T: NumLike {
8042 type Output = InverseMomentum<T>;
8043 fn div(self, rhs: Velocity<T>) -> Self::Output {
8044 InverseMomentum{s_per_kgm: self.per_kg.clone() / rhs.mps}
8045 }
8046}
8047impl<T> core::ops::Div<&Velocity<T>> for InverseMass<T> where T: NumLike {
8049 type Output = InverseMomentum<T>;
8050 fn div(self, rhs: &Velocity<T>) -> Self::Output {
8051 InverseMomentum{s_per_kgm: self.per_kg / rhs.mps.clone()}
8052 }
8053}
8054impl<T> core::ops::Div<&Velocity<T>> for &InverseMass<T> where T: NumLike {
8056 type Output = InverseMomentum<T>;
8057 fn div(self, rhs: &Velocity<T>) -> Self::Output {
8058 InverseMomentum{s_per_kgm: self.per_kg.clone() / rhs.mps.clone()}
8059 }
8060}
8061
8062impl<T> core::ops::Div<VolumePerMass<T>> for InverseMass<T> where T: NumLike {
8065 type Output = InverseVolume<T>;
8066 fn div(self, rhs: VolumePerMass<T>) -> Self::Output {
8067 InverseVolume{per_m3: self.per_kg / rhs.m3_per_kg}
8068 }
8069}
8070impl<T> core::ops::Div<VolumePerMass<T>> for &InverseMass<T> where T: NumLike {
8072 type Output = InverseVolume<T>;
8073 fn div(self, rhs: VolumePerMass<T>) -> Self::Output {
8074 InverseVolume{per_m3: self.per_kg.clone() / rhs.m3_per_kg}
8075 }
8076}
8077impl<T> core::ops::Div<&VolumePerMass<T>> for InverseMass<T> where T: NumLike {
8079 type Output = InverseVolume<T>;
8080 fn div(self, rhs: &VolumePerMass<T>) -> Self::Output {
8081 InverseVolume{per_m3: self.per_kg / rhs.m3_per_kg.clone()}
8082 }
8083}
8084impl<T> core::ops::Div<&VolumePerMass<T>> for &InverseMass<T> where T: NumLike {
8086 type Output = InverseVolume<T>;
8087 fn div(self, rhs: &VolumePerMass<T>) -> Self::Output {
8088 InverseVolume{per_m3: self.per_kg.clone() / rhs.m3_per_kg.clone()}
8089 }
8090}
8091
8092impl<T> core::ops::Mul<InverseAbsorbedDose<T>> for InverseMass<T> where T: NumLike {
8095 type Output = InverseEnergy<T>;
8096 fn mul(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
8097 InverseEnergy{per_J: self.per_kg * rhs.per_Gy}
8098 }
8099}
8100impl<T> core::ops::Mul<InverseAbsorbedDose<T>> for &InverseMass<T> where T: NumLike {
8102 type Output = InverseEnergy<T>;
8103 fn mul(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
8104 InverseEnergy{per_J: self.per_kg.clone() * rhs.per_Gy}
8105 }
8106}
8107impl<T> core::ops::Mul<&InverseAbsorbedDose<T>> for InverseMass<T> where T: NumLike {
8109 type Output = InverseEnergy<T>;
8110 fn mul(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
8111 InverseEnergy{per_J: self.per_kg * rhs.per_Gy.clone()}
8112 }
8113}
8114impl<T> core::ops::Mul<&InverseAbsorbedDose<T>> for &InverseMass<T> where T: NumLike {
8116 type Output = InverseEnergy<T>;
8117 fn mul(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
8118 InverseEnergy{per_J: self.per_kg.clone() * rhs.per_Gy.clone()}
8119 }
8120}
8121
8122impl<T> core::ops::Mul<InverseDoseEquivalent<T>> for InverseMass<T> where T: NumLike {
8125 type Output = InverseEnergy<T>;
8126 fn mul(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
8127 InverseEnergy{per_J: self.per_kg * rhs.per_Sv}
8128 }
8129}
8130impl<T> core::ops::Mul<InverseDoseEquivalent<T>> for &InverseMass<T> where T: NumLike {
8132 type Output = InverseEnergy<T>;
8133 fn mul(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
8134 InverseEnergy{per_J: self.per_kg.clone() * rhs.per_Sv}
8135 }
8136}
8137impl<T> core::ops::Mul<&InverseDoseEquivalent<T>> for InverseMass<T> where T: NumLike {
8139 type Output = InverseEnergy<T>;
8140 fn mul(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
8141 InverseEnergy{per_J: self.per_kg * rhs.per_Sv.clone()}
8142 }
8143}
8144impl<T> core::ops::Mul<&InverseDoseEquivalent<T>> for &InverseMass<T> where T: NumLike {
8146 type Output = InverseEnergy<T>;
8147 fn mul(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
8148 InverseEnergy{per_J: self.per_kg.clone() * rhs.per_Sv.clone()}
8149 }
8150}
8151
8152impl<T> core::ops::Div<InverseMass<T>> for f64 where T: NumLike+From<f64> {
8155 type Output = Mass<T>;
8156 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8157 Mass{kg: T::from(self) / rhs.per_kg}
8158 }
8159}
8160impl<T> core::ops::Div<InverseMass<T>> for &f64 where T: NumLike+From<f64> {
8162 type Output = Mass<T>;
8163 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8164 Mass{kg: T::from(self.clone()) / rhs.per_kg}
8165 }
8166}
8167impl<T> core::ops::Div<&InverseMass<T>> for f64 where T: NumLike+From<f64> {
8169 type Output = Mass<T>;
8170 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8171 Mass{kg: T::from(self) / rhs.per_kg.clone()}
8172 }
8173}
8174impl<T> core::ops::Div<&InverseMass<T>> for &f64 where T: NumLike+From<f64> {
8176 type Output = Mass<T>;
8177 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8178 Mass{kg: T::from(self.clone()) / rhs.per_kg.clone()}
8179 }
8180}
8181
8182impl<T> core::ops::Div<InverseMass<T>> for f32 where T: NumLike+From<f32> {
8185 type Output = Mass<T>;
8186 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8187 Mass{kg: T::from(self) / rhs.per_kg}
8188 }
8189}
8190impl<T> core::ops::Div<InverseMass<T>> for &f32 where T: NumLike+From<f32> {
8192 type Output = Mass<T>;
8193 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8194 Mass{kg: T::from(self.clone()) / rhs.per_kg}
8195 }
8196}
8197impl<T> core::ops::Div<&InverseMass<T>> for f32 where T: NumLike+From<f32> {
8199 type Output = Mass<T>;
8200 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8201 Mass{kg: T::from(self) / rhs.per_kg.clone()}
8202 }
8203}
8204impl<T> core::ops::Div<&InverseMass<T>> for &f32 where T: NumLike+From<f32> {
8206 type Output = Mass<T>;
8207 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8208 Mass{kg: T::from(self.clone()) / rhs.per_kg.clone()}
8209 }
8210}
8211
8212impl<T> core::ops::Div<InverseMass<T>> for i64 where T: NumLike+From<i64> {
8215 type Output = Mass<T>;
8216 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8217 Mass{kg: T::from(self) / rhs.per_kg}
8218 }
8219}
8220impl<T> core::ops::Div<InverseMass<T>> for &i64 where T: NumLike+From<i64> {
8222 type Output = Mass<T>;
8223 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8224 Mass{kg: T::from(self.clone()) / rhs.per_kg}
8225 }
8226}
8227impl<T> core::ops::Div<&InverseMass<T>> for i64 where T: NumLike+From<i64> {
8229 type Output = Mass<T>;
8230 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8231 Mass{kg: T::from(self) / rhs.per_kg.clone()}
8232 }
8233}
8234impl<T> core::ops::Div<&InverseMass<T>> for &i64 where T: NumLike+From<i64> {
8236 type Output = Mass<T>;
8237 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8238 Mass{kg: T::from(self.clone()) / rhs.per_kg.clone()}
8239 }
8240}
8241
8242impl<T> core::ops::Div<InverseMass<T>> for i32 where T: NumLike+From<i32> {
8245 type Output = Mass<T>;
8246 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8247 Mass{kg: T::from(self) / rhs.per_kg}
8248 }
8249}
8250impl<T> core::ops::Div<InverseMass<T>> for &i32 where T: NumLike+From<i32> {
8252 type Output = Mass<T>;
8253 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8254 Mass{kg: T::from(self.clone()) / rhs.per_kg}
8255 }
8256}
8257impl<T> core::ops::Div<&InverseMass<T>> for i32 where T: NumLike+From<i32> {
8259 type Output = Mass<T>;
8260 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8261 Mass{kg: T::from(self) / rhs.per_kg.clone()}
8262 }
8263}
8264impl<T> core::ops::Div<&InverseMass<T>> for &i32 where T: NumLike+From<i32> {
8266 type Output = Mass<T>;
8267 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8268 Mass{kg: T::from(self.clone()) / rhs.per_kg.clone()}
8269 }
8270}
8271
8272#[cfg(feature="num-bigfloat")]
8275impl<T> core::ops::Div<InverseMass<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
8276 type Output = Mass<T>;
8277 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8278 Mass{kg: T::from(self) / rhs.per_kg}
8279 }
8280}
8281#[cfg(feature="num-bigfloat")]
8283impl<T> core::ops::Div<InverseMass<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
8284 type Output = Mass<T>;
8285 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8286 Mass{kg: T::from(self.clone()) / rhs.per_kg}
8287 }
8288}
8289#[cfg(feature="num-bigfloat")]
8291impl<T> core::ops::Div<&InverseMass<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
8292 type Output = Mass<T>;
8293 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8294 Mass{kg: T::from(self) / rhs.per_kg.clone()}
8295 }
8296}
8297#[cfg(feature="num-bigfloat")]
8299impl<T> core::ops::Div<&InverseMass<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
8300 type Output = Mass<T>;
8301 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8302 Mass{kg: T::from(self.clone()) / rhs.per_kg.clone()}
8303 }
8304}
8305
8306#[cfg(feature="num-complex")]
8309impl<T> core::ops::Div<InverseMass<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
8310 type Output = Mass<T>;
8311 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8312 Mass{kg: T::from(self) / rhs.per_kg}
8313 }
8314}
8315#[cfg(feature="num-complex")]
8317impl<T> core::ops::Div<InverseMass<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
8318 type Output = Mass<T>;
8319 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8320 Mass{kg: T::from(self.clone()) / rhs.per_kg}
8321 }
8322}
8323#[cfg(feature="num-complex")]
8325impl<T> core::ops::Div<&InverseMass<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
8326 type Output = Mass<T>;
8327 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8328 Mass{kg: T::from(self) / rhs.per_kg.clone()}
8329 }
8330}
8331#[cfg(feature="num-complex")]
8333impl<T> core::ops::Div<&InverseMass<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
8334 type Output = Mass<T>;
8335 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8336 Mass{kg: T::from(self.clone()) / rhs.per_kg.clone()}
8337 }
8338}
8339
8340#[cfg(feature="num-complex")]
8343impl<T> core::ops::Div<InverseMass<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
8344 type Output = Mass<T>;
8345 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8346 Mass{kg: T::from(self) / rhs.per_kg}
8347 }
8348}
8349#[cfg(feature="num-complex")]
8351impl<T> core::ops::Div<InverseMass<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
8352 type Output = Mass<T>;
8353 fn div(self, rhs: InverseMass<T>) -> Self::Output {
8354 Mass{kg: T::from(self.clone()) / rhs.per_kg}
8355 }
8356}
8357#[cfg(feature="num-complex")]
8359impl<T> core::ops::Div<&InverseMass<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
8360 type Output = Mass<T>;
8361 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8362 Mass{kg: T::from(self) / rhs.per_kg.clone()}
8363 }
8364}
8365#[cfg(feature="num-complex")]
8367impl<T> core::ops::Div<&InverseMass<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
8368 type Output = Mass<T>;
8369 fn div(self, rhs: &InverseMass<T>) -> Self::Output {
8370 Mass{kg: T::from(self.clone()) / rhs.per_kg.clone()}
8371 }
8372}
8373
8374#[derive(UnitStruct, Debug, Clone)]
8376#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
8377pub struct InverseTemperature<T: NumLike>{
8378 pub per_K: T
8380}
8381
8382impl<T> InverseTemperature<T> where T: NumLike {
8383
8384 pub fn unit_name() -> &'static str { "inverse degrees kelvin" }
8386
8387 pub fn unit_symbol() -> &'static str { "1/K" }
8389
8390 pub fn from_per_K(per_K: T) -> Self { InverseTemperature{per_K: per_K} }
8395
8396 pub fn to_per_K(&self) -> T { self.per_K.clone() }
8398
8399}
8400
8401impl<T> fmt::Display for InverseTemperature<T> where T: NumLike {
8402 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8403 write!(f, "{} {}", &self.per_K, Self::unit_symbol())
8404 }
8405}
8406
8407impl<T> InverseTemperature<T> where T: NumLike+From<f64> {
8408
8409}
8410
8411
8412#[cfg(feature="num-bigfloat")]
8414impl core::ops::Mul<InverseTemperature<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
8415 type Output = InverseTemperature<num_bigfloat::BigFloat>;
8416 fn mul(self, rhs: InverseTemperature<num_bigfloat::BigFloat>) -> Self::Output {
8417 InverseTemperature{per_K: self * rhs.per_K}
8418 }
8419}
8420#[cfg(feature="num-bigfloat")]
8422impl core::ops::Mul<InverseTemperature<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
8423 type Output = InverseTemperature<num_bigfloat::BigFloat>;
8424 fn mul(self, rhs: InverseTemperature<num_bigfloat::BigFloat>) -> Self::Output {
8425 InverseTemperature{per_K: self.clone() * rhs.per_K}
8426 }
8427}
8428#[cfg(feature="num-bigfloat")]
8430impl core::ops::Mul<&InverseTemperature<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
8431 type Output = InverseTemperature<num_bigfloat::BigFloat>;
8432 fn mul(self, rhs: &InverseTemperature<num_bigfloat::BigFloat>) -> Self::Output {
8433 InverseTemperature{per_K: self * rhs.per_K.clone()}
8434 }
8435}
8436#[cfg(feature="num-bigfloat")]
8438impl core::ops::Mul<&InverseTemperature<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
8439 type Output = InverseTemperature<num_bigfloat::BigFloat>;
8440 fn mul(self, rhs: &InverseTemperature<num_bigfloat::BigFloat>) -> Self::Output {
8441 InverseTemperature{per_K: self.clone() * rhs.per_K.clone()}
8442 }
8443}
8444
8445#[cfg(feature="num-complex")]
8447impl core::ops::Mul<InverseTemperature<num_complex::Complex32>> for num_complex::Complex32 {
8448 type Output = InverseTemperature<num_complex::Complex32>;
8449 fn mul(self, rhs: InverseTemperature<num_complex::Complex32>) -> Self::Output {
8450 InverseTemperature{per_K: self * rhs.per_K}
8451 }
8452}
8453#[cfg(feature="num-complex")]
8455impl core::ops::Mul<InverseTemperature<num_complex::Complex32>> for &num_complex::Complex32 {
8456 type Output = InverseTemperature<num_complex::Complex32>;
8457 fn mul(self, rhs: InverseTemperature<num_complex::Complex32>) -> Self::Output {
8458 InverseTemperature{per_K: self.clone() * rhs.per_K}
8459 }
8460}
8461#[cfg(feature="num-complex")]
8463impl core::ops::Mul<&InverseTemperature<num_complex::Complex32>> for num_complex::Complex32 {
8464 type Output = InverseTemperature<num_complex::Complex32>;
8465 fn mul(self, rhs: &InverseTemperature<num_complex::Complex32>) -> Self::Output {
8466 InverseTemperature{per_K: self * rhs.per_K.clone()}
8467 }
8468}
8469#[cfg(feature="num-complex")]
8471impl core::ops::Mul<&InverseTemperature<num_complex::Complex32>> for &num_complex::Complex32 {
8472 type Output = InverseTemperature<num_complex::Complex32>;
8473 fn mul(self, rhs: &InverseTemperature<num_complex::Complex32>) -> Self::Output {
8474 InverseTemperature{per_K: self.clone() * rhs.per_K.clone()}
8475 }
8476}
8477
8478#[cfg(feature="num-complex")]
8480impl core::ops::Mul<InverseTemperature<num_complex::Complex64>> for num_complex::Complex64 {
8481 type Output = InverseTemperature<num_complex::Complex64>;
8482 fn mul(self, rhs: InverseTemperature<num_complex::Complex64>) -> Self::Output {
8483 InverseTemperature{per_K: self * rhs.per_K}
8484 }
8485}
8486#[cfg(feature="num-complex")]
8488impl core::ops::Mul<InverseTemperature<num_complex::Complex64>> for &num_complex::Complex64 {
8489 type Output = InverseTemperature<num_complex::Complex64>;
8490 fn mul(self, rhs: InverseTemperature<num_complex::Complex64>) -> Self::Output {
8491 InverseTemperature{per_K: self.clone() * rhs.per_K}
8492 }
8493}
8494#[cfg(feature="num-complex")]
8496impl core::ops::Mul<&InverseTemperature<num_complex::Complex64>> for num_complex::Complex64 {
8497 type Output = InverseTemperature<num_complex::Complex64>;
8498 fn mul(self, rhs: &InverseTemperature<num_complex::Complex64>) -> Self::Output {
8499 InverseTemperature{per_K: self * rhs.per_K.clone()}
8500 }
8501}
8502#[cfg(feature="num-complex")]
8504impl core::ops::Mul<&InverseTemperature<num_complex::Complex64>> for &num_complex::Complex64 {
8505 type Output = InverseTemperature<num_complex::Complex64>;
8506 fn mul(self, rhs: &InverseTemperature<num_complex::Complex64>) -> Self::Output {
8507 InverseTemperature{per_K: self.clone() * rhs.per_K.clone()}
8508 }
8509}
8510
8511
8512
8513#[cfg(feature = "uom")]
8515impl<T> Into<uom::si::f32::TemperatureCoefficient> for InverseTemperature<T> where T: NumLike+Into<f32> {
8516 fn into(self) -> uom::si::f32::TemperatureCoefficient {
8517 uom::si::f32::TemperatureCoefficient::new::<uom::si::temperature_coefficient::per_kelvin>(self.per_K.into())
8518 }
8519}
8520
8521#[cfg(feature = "uom")]
8523impl<T> From<uom::si::f32::TemperatureCoefficient> for InverseTemperature<T> where T: NumLike+From<f32> {
8524 fn from(src: uom::si::f32::TemperatureCoefficient) -> Self {
8525 InverseTemperature{per_K: T::from(src.value)}
8526 }
8527}
8528
8529#[cfg(feature = "uom")]
8531impl<T> Into<uom::si::f64::TemperatureCoefficient> for InverseTemperature<T> where T: NumLike+Into<f64> {
8532 fn into(self) -> uom::si::f64::TemperatureCoefficient {
8533 uom::si::f64::TemperatureCoefficient::new::<uom::si::temperature_coefficient::per_kelvin>(self.per_K.into())
8534 }
8535}
8536
8537#[cfg(feature = "uom")]
8539impl<T> From<uom::si::f64::TemperatureCoefficient> for InverseTemperature<T> where T: NumLike+From<f64> {
8540 fn from(src: uom::si::f64::TemperatureCoefficient) -> Self {
8541 InverseTemperature{per_K: T::from(src.value)}
8542 }
8543}
8544
8545
8546impl<T> core::ops::Div<InverseAbsorbedDose<T>> for InverseTemperature<T> where T: NumLike {
8549 type Output = SpecificHeatCapacity<T>;
8550 fn div(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
8551 SpecificHeatCapacity{J_per_kgK: self.per_K / rhs.per_Gy}
8552 }
8553}
8554impl<T> core::ops::Div<InverseAbsorbedDose<T>> for &InverseTemperature<T> where T: NumLike {
8556 type Output = SpecificHeatCapacity<T>;
8557 fn div(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
8558 SpecificHeatCapacity{J_per_kgK: self.per_K.clone() / rhs.per_Gy}
8559 }
8560}
8561impl<T> core::ops::Div<&InverseAbsorbedDose<T>> for InverseTemperature<T> where T: NumLike {
8563 type Output = SpecificHeatCapacity<T>;
8564 fn div(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
8565 SpecificHeatCapacity{J_per_kgK: self.per_K / rhs.per_Gy.clone()}
8566 }
8567}
8568impl<T> core::ops::Div<&InverseAbsorbedDose<T>> for &InverseTemperature<T> where T: NumLike {
8570 type Output = SpecificHeatCapacity<T>;
8571 fn div(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
8572 SpecificHeatCapacity{J_per_kgK: self.per_K.clone() / rhs.per_Gy.clone()}
8573 }
8574}
8575
8576impl<T> core::ops::Div<InverseDoseEquivalent<T>> for InverseTemperature<T> where T: NumLike {
8579 type Output = SpecificHeatCapacity<T>;
8580 fn div(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
8581 SpecificHeatCapacity{J_per_kgK: self.per_K / rhs.per_Sv}
8582 }
8583}
8584impl<T> core::ops::Div<InverseDoseEquivalent<T>> for &InverseTemperature<T> where T: NumLike {
8586 type Output = SpecificHeatCapacity<T>;
8587 fn div(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
8588 SpecificHeatCapacity{J_per_kgK: self.per_K.clone() / rhs.per_Sv}
8589 }
8590}
8591impl<T> core::ops::Div<&InverseDoseEquivalent<T>> for InverseTemperature<T> where T: NumLike {
8593 type Output = SpecificHeatCapacity<T>;
8594 fn div(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
8595 SpecificHeatCapacity{J_per_kgK: self.per_K / rhs.per_Sv.clone()}
8596 }
8597}
8598impl<T> core::ops::Div<&InverseDoseEquivalent<T>> for &InverseTemperature<T> where T: NumLike {
8600 type Output = SpecificHeatCapacity<T>;
8601 fn div(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
8602 SpecificHeatCapacity{J_per_kgK: self.per_K.clone() / rhs.per_Sv.clone()}
8603 }
8604}
8605
8606impl<T> core::ops::Div<InverseTemperature<T>> for f64 where T: NumLike+From<f64> {
8609 type Output = Temperature<T>;
8610 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8611 Temperature{K: T::from(self) / rhs.per_K}
8612 }
8613}
8614impl<T> core::ops::Div<InverseTemperature<T>> for &f64 where T: NumLike+From<f64> {
8616 type Output = Temperature<T>;
8617 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8618 Temperature{K: T::from(self.clone()) / rhs.per_K}
8619 }
8620}
8621impl<T> core::ops::Div<&InverseTemperature<T>> for f64 where T: NumLike+From<f64> {
8623 type Output = Temperature<T>;
8624 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8625 Temperature{K: T::from(self) / rhs.per_K.clone()}
8626 }
8627}
8628impl<T> core::ops::Div<&InverseTemperature<T>> for &f64 where T: NumLike+From<f64> {
8630 type Output = Temperature<T>;
8631 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8632 Temperature{K: T::from(self.clone()) / rhs.per_K.clone()}
8633 }
8634}
8635
8636impl<T> core::ops::Div<InverseTemperature<T>> for f32 where T: NumLike+From<f32> {
8639 type Output = Temperature<T>;
8640 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8641 Temperature{K: T::from(self) / rhs.per_K}
8642 }
8643}
8644impl<T> core::ops::Div<InverseTemperature<T>> for &f32 where T: NumLike+From<f32> {
8646 type Output = Temperature<T>;
8647 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8648 Temperature{K: T::from(self.clone()) / rhs.per_K}
8649 }
8650}
8651impl<T> core::ops::Div<&InverseTemperature<T>> for f32 where T: NumLike+From<f32> {
8653 type Output = Temperature<T>;
8654 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8655 Temperature{K: T::from(self) / rhs.per_K.clone()}
8656 }
8657}
8658impl<T> core::ops::Div<&InverseTemperature<T>> for &f32 where T: NumLike+From<f32> {
8660 type Output = Temperature<T>;
8661 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8662 Temperature{K: T::from(self.clone()) / rhs.per_K.clone()}
8663 }
8664}
8665
8666impl<T> core::ops::Div<InverseTemperature<T>> for i64 where T: NumLike+From<i64> {
8669 type Output = Temperature<T>;
8670 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8671 Temperature{K: T::from(self) / rhs.per_K}
8672 }
8673}
8674impl<T> core::ops::Div<InverseTemperature<T>> for &i64 where T: NumLike+From<i64> {
8676 type Output = Temperature<T>;
8677 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8678 Temperature{K: T::from(self.clone()) / rhs.per_K}
8679 }
8680}
8681impl<T> core::ops::Div<&InverseTemperature<T>> for i64 where T: NumLike+From<i64> {
8683 type Output = Temperature<T>;
8684 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8685 Temperature{K: T::from(self) / rhs.per_K.clone()}
8686 }
8687}
8688impl<T> core::ops::Div<&InverseTemperature<T>> for &i64 where T: NumLike+From<i64> {
8690 type Output = Temperature<T>;
8691 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8692 Temperature{K: T::from(self.clone()) / rhs.per_K.clone()}
8693 }
8694}
8695
8696impl<T> core::ops::Div<InverseTemperature<T>> for i32 where T: NumLike+From<i32> {
8699 type Output = Temperature<T>;
8700 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8701 Temperature{K: T::from(self) / rhs.per_K}
8702 }
8703}
8704impl<T> core::ops::Div<InverseTemperature<T>> for &i32 where T: NumLike+From<i32> {
8706 type Output = Temperature<T>;
8707 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8708 Temperature{K: T::from(self.clone()) / rhs.per_K}
8709 }
8710}
8711impl<T> core::ops::Div<&InverseTemperature<T>> for i32 where T: NumLike+From<i32> {
8713 type Output = Temperature<T>;
8714 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8715 Temperature{K: T::from(self) / rhs.per_K.clone()}
8716 }
8717}
8718impl<T> core::ops::Div<&InverseTemperature<T>> for &i32 where T: NumLike+From<i32> {
8720 type Output = Temperature<T>;
8721 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8722 Temperature{K: T::from(self.clone()) / rhs.per_K.clone()}
8723 }
8724}
8725
8726#[cfg(feature="num-bigfloat")]
8729impl<T> core::ops::Div<InverseTemperature<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
8730 type Output = Temperature<T>;
8731 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8732 Temperature{K: T::from(self) / rhs.per_K}
8733 }
8734}
8735#[cfg(feature="num-bigfloat")]
8737impl<T> core::ops::Div<InverseTemperature<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
8738 type Output = Temperature<T>;
8739 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8740 Temperature{K: T::from(self.clone()) / rhs.per_K}
8741 }
8742}
8743#[cfg(feature="num-bigfloat")]
8745impl<T> core::ops::Div<&InverseTemperature<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
8746 type Output = Temperature<T>;
8747 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8748 Temperature{K: T::from(self) / rhs.per_K.clone()}
8749 }
8750}
8751#[cfg(feature="num-bigfloat")]
8753impl<T> core::ops::Div<&InverseTemperature<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
8754 type Output = Temperature<T>;
8755 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8756 Temperature{K: T::from(self.clone()) / rhs.per_K.clone()}
8757 }
8758}
8759
8760#[cfg(feature="num-complex")]
8763impl<T> core::ops::Div<InverseTemperature<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
8764 type Output = Temperature<T>;
8765 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8766 Temperature{K: T::from(self) / rhs.per_K}
8767 }
8768}
8769#[cfg(feature="num-complex")]
8771impl<T> core::ops::Div<InverseTemperature<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
8772 type Output = Temperature<T>;
8773 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8774 Temperature{K: T::from(self.clone()) / rhs.per_K}
8775 }
8776}
8777#[cfg(feature="num-complex")]
8779impl<T> core::ops::Div<&InverseTemperature<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
8780 type Output = Temperature<T>;
8781 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8782 Temperature{K: T::from(self) / rhs.per_K.clone()}
8783 }
8784}
8785#[cfg(feature="num-complex")]
8787impl<T> core::ops::Div<&InverseTemperature<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
8788 type Output = Temperature<T>;
8789 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8790 Temperature{K: T::from(self.clone()) / rhs.per_K.clone()}
8791 }
8792}
8793
8794#[cfg(feature="num-complex")]
8797impl<T> core::ops::Div<InverseTemperature<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
8798 type Output = Temperature<T>;
8799 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8800 Temperature{K: T::from(self) / rhs.per_K}
8801 }
8802}
8803#[cfg(feature="num-complex")]
8805impl<T> core::ops::Div<InverseTemperature<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
8806 type Output = Temperature<T>;
8807 fn div(self, rhs: InverseTemperature<T>) -> Self::Output {
8808 Temperature{K: T::from(self.clone()) / rhs.per_K}
8809 }
8810}
8811#[cfg(feature="num-complex")]
8813impl<T> core::ops::Div<&InverseTemperature<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
8814 type Output = Temperature<T>;
8815 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8816 Temperature{K: T::from(self) / rhs.per_K.clone()}
8817 }
8818}
8819#[cfg(feature="num-complex")]
8821impl<T> core::ops::Div<&InverseTemperature<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
8822 type Output = Temperature<T>;
8823 fn div(self, rhs: &InverseTemperature<T>) -> Self::Output {
8824 Temperature{K: T::from(self.clone()) / rhs.per_K.clone()}
8825 }
8826}
8827
8828#[derive(UnitStruct, Debug, Clone)]
8830#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
8831pub struct Luminosity<T: NumLike>{
8832 pub cd: T
8834}
8835
8836impl<T> Luminosity<T> where T: NumLike {
8837
8838 pub fn unit_name() -> &'static str { "candela" }
8840
8841 pub fn unit_symbol() -> &'static str { "cd" }
8843
8844 pub fn from_cd(cd: T) -> Self { Luminosity{cd: cd} }
8849
8850 pub fn to_cd(&self) -> T { self.cd.clone() }
8852
8853 pub fn from_candela(candela: T) -> Self { Luminosity{cd: candela} }
8858
8859 pub fn to_candela(&self) -> T { self.cd.clone() }
8861
8862}
8863
8864impl<T> fmt::Display for Luminosity<T> where T: NumLike {
8865 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8866 write!(f, "{} {}", &self.cd, Self::unit_symbol())
8867 }
8868}
8869
8870impl<T> Luminosity<T> where T: NumLike+From<f64> {
8871
8872 pub fn to_mcd(&self) -> T {
8876 return self.cd.clone() * T::from(1000.0_f64);
8877 }
8878
8879 pub fn from_mcd(mcd: T) -> Self {
8886 Luminosity{cd: mcd * T::from(0.001_f64)}
8887 }
8888
8889 pub fn to_ucd(&self) -> T {
8893 return self.cd.clone() * T::from(1000000.0_f64);
8894 }
8895
8896 pub fn from_ucd(ucd: T) -> Self {
8903 Luminosity{cd: ucd * T::from(1e-06_f64)}
8904 }
8905
8906 pub fn to_ncd(&self) -> T {
8910 return self.cd.clone() * T::from(1000000000.0_f64);
8911 }
8912
8913 pub fn from_ncd(ncd: T) -> Self {
8920 Luminosity{cd: ncd * T::from(1e-09_f64)}
8921 }
8922
8923 pub fn to_kcd(&self) -> T {
8927 return self.cd.clone() * T::from(0.001_f64);
8928 }
8929
8930 pub fn from_kcd(kcd: T) -> Self {
8937 Luminosity{cd: kcd * T::from(1000.0_f64)}
8938 }
8939
8940 pub fn to_Mcd(&self) -> T {
8944 return self.cd.clone() * T::from(1e-06_f64);
8945 }
8946
8947 pub fn from_Mcd(Mcd: T) -> Self {
8954 Luminosity{cd: Mcd * T::from(1000000.0_f64)}
8955 }
8956
8957 pub fn to_Gcd(&self) -> T {
8961 return self.cd.clone() * T::from(1e-09_f64);
8962 }
8963
8964 pub fn from_Gcd(Gcd: T) -> Self {
8971 Luminosity{cd: Gcd * T::from(1000000000.0_f64)}
8972 }
8973
8974}
8975
8976
8977#[cfg(feature="num-bigfloat")]
8979impl core::ops::Mul<Luminosity<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
8980 type Output = Luminosity<num_bigfloat::BigFloat>;
8981 fn mul(self, rhs: Luminosity<num_bigfloat::BigFloat>) -> Self::Output {
8982 Luminosity{cd: self * rhs.cd}
8983 }
8984}
8985#[cfg(feature="num-bigfloat")]
8987impl core::ops::Mul<Luminosity<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
8988 type Output = Luminosity<num_bigfloat::BigFloat>;
8989 fn mul(self, rhs: Luminosity<num_bigfloat::BigFloat>) -> Self::Output {
8990 Luminosity{cd: self.clone() * rhs.cd}
8991 }
8992}
8993#[cfg(feature="num-bigfloat")]
8995impl core::ops::Mul<&Luminosity<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
8996 type Output = Luminosity<num_bigfloat::BigFloat>;
8997 fn mul(self, rhs: &Luminosity<num_bigfloat::BigFloat>) -> Self::Output {
8998 Luminosity{cd: self * rhs.cd.clone()}
8999 }
9000}
9001#[cfg(feature="num-bigfloat")]
9003impl core::ops::Mul<&Luminosity<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
9004 type Output = Luminosity<num_bigfloat::BigFloat>;
9005 fn mul(self, rhs: &Luminosity<num_bigfloat::BigFloat>) -> Self::Output {
9006 Luminosity{cd: self.clone() * rhs.cd.clone()}
9007 }
9008}
9009
9010#[cfg(feature="num-complex")]
9012impl core::ops::Mul<Luminosity<num_complex::Complex32>> for num_complex::Complex32 {
9013 type Output = Luminosity<num_complex::Complex32>;
9014 fn mul(self, rhs: Luminosity<num_complex::Complex32>) -> Self::Output {
9015 Luminosity{cd: self * rhs.cd}
9016 }
9017}
9018#[cfg(feature="num-complex")]
9020impl core::ops::Mul<Luminosity<num_complex::Complex32>> for &num_complex::Complex32 {
9021 type Output = Luminosity<num_complex::Complex32>;
9022 fn mul(self, rhs: Luminosity<num_complex::Complex32>) -> Self::Output {
9023 Luminosity{cd: self.clone() * rhs.cd}
9024 }
9025}
9026#[cfg(feature="num-complex")]
9028impl core::ops::Mul<&Luminosity<num_complex::Complex32>> for num_complex::Complex32 {
9029 type Output = Luminosity<num_complex::Complex32>;
9030 fn mul(self, rhs: &Luminosity<num_complex::Complex32>) -> Self::Output {
9031 Luminosity{cd: self * rhs.cd.clone()}
9032 }
9033}
9034#[cfg(feature="num-complex")]
9036impl core::ops::Mul<&Luminosity<num_complex::Complex32>> for &num_complex::Complex32 {
9037 type Output = Luminosity<num_complex::Complex32>;
9038 fn mul(self, rhs: &Luminosity<num_complex::Complex32>) -> Self::Output {
9039 Luminosity{cd: self.clone() * rhs.cd.clone()}
9040 }
9041}
9042
9043#[cfg(feature="num-complex")]
9045impl core::ops::Mul<Luminosity<num_complex::Complex64>> for num_complex::Complex64 {
9046 type Output = Luminosity<num_complex::Complex64>;
9047 fn mul(self, rhs: Luminosity<num_complex::Complex64>) -> Self::Output {
9048 Luminosity{cd: self * rhs.cd}
9049 }
9050}
9051#[cfg(feature="num-complex")]
9053impl core::ops::Mul<Luminosity<num_complex::Complex64>> for &num_complex::Complex64 {
9054 type Output = Luminosity<num_complex::Complex64>;
9055 fn mul(self, rhs: Luminosity<num_complex::Complex64>) -> Self::Output {
9056 Luminosity{cd: self.clone() * rhs.cd}
9057 }
9058}
9059#[cfg(feature="num-complex")]
9061impl core::ops::Mul<&Luminosity<num_complex::Complex64>> for num_complex::Complex64 {
9062 type Output = Luminosity<num_complex::Complex64>;
9063 fn mul(self, rhs: &Luminosity<num_complex::Complex64>) -> Self::Output {
9064 Luminosity{cd: self * rhs.cd.clone()}
9065 }
9066}
9067#[cfg(feature="num-complex")]
9069impl core::ops::Mul<&Luminosity<num_complex::Complex64>> for &num_complex::Complex64 {
9070 type Output = Luminosity<num_complex::Complex64>;
9071 fn mul(self, rhs: &Luminosity<num_complex::Complex64>) -> Self::Output {
9072 Luminosity{cd: self.clone() * rhs.cd.clone()}
9073 }
9074}
9075
9076
9077
9078#[cfg(feature = "uom")]
9080impl<T> Into<uom::si::f32::LuminousIntensity> for Luminosity<T> where T: NumLike+Into<f32> {
9081 fn into(self) -> uom::si::f32::LuminousIntensity {
9082 uom::si::f32::LuminousIntensity::new::<uom::si::luminous_intensity::candela>(self.cd.into())
9083 }
9084}
9085
9086#[cfg(feature = "uom")]
9088impl<T> From<uom::si::f32::LuminousIntensity> for Luminosity<T> where T: NumLike+From<f32> {
9089 fn from(src: uom::si::f32::LuminousIntensity) -> Self {
9090 Luminosity{cd: T::from(src.value)}
9091 }
9092}
9093
9094#[cfg(feature = "uom")]
9096impl<T> Into<uom::si::f64::LuminousIntensity> for Luminosity<T> where T: NumLike+Into<f64> {
9097 fn into(self) -> uom::si::f64::LuminousIntensity {
9098 uom::si::f64::LuminousIntensity::new::<uom::si::luminous_intensity::candela>(self.cd.into())
9099 }
9100}
9101
9102#[cfg(feature = "uom")]
9104impl<T> From<uom::si::f64::LuminousIntensity> for Luminosity<T> where T: NumLike+From<f64> {
9105 fn from(src: uom::si::f64::LuminousIntensity) -> Self {
9106 Luminosity{cd: T::from(src.value)}
9107 }
9108}
9109
9110
9111impl<T> core::ops::Mul<InverseLuminousFlux<T>> for Luminosity<T> where T: NumLike {
9114 type Output = InverseSolidAngle<T>;
9115 fn mul(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
9116 InverseSolidAngle{per_sr: self.cd * rhs.per_lm}
9117 }
9118}
9119impl<T> core::ops::Mul<InverseLuminousFlux<T>> for &Luminosity<T> where T: NumLike {
9121 type Output = InverseSolidAngle<T>;
9122 fn mul(self, rhs: InverseLuminousFlux<T>) -> Self::Output {
9123 InverseSolidAngle{per_sr: self.cd.clone() * rhs.per_lm}
9124 }
9125}
9126impl<T> core::ops::Mul<&InverseLuminousFlux<T>> for Luminosity<T> where T: NumLike {
9128 type Output = InverseSolidAngle<T>;
9129 fn mul(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
9130 InverseSolidAngle{per_sr: self.cd * rhs.per_lm.clone()}
9131 }
9132}
9133impl<T> core::ops::Mul<&InverseLuminousFlux<T>> for &Luminosity<T> where T: NumLike {
9135 type Output = InverseSolidAngle<T>;
9136 fn mul(self, rhs: &InverseLuminousFlux<T>) -> Self::Output {
9137 InverseSolidAngle{per_sr: self.cd.clone() * rhs.per_lm.clone()}
9138 }
9139}
9140
9141impl<T> core::ops::Div<LuminousFlux<T>> for Luminosity<T> where T: NumLike {
9144 type Output = InverseSolidAngle<T>;
9145 fn div(self, rhs: LuminousFlux<T>) -> Self::Output {
9146 InverseSolidAngle{per_sr: self.cd / rhs.lm}
9147 }
9148}
9149impl<T> core::ops::Div<LuminousFlux<T>> for &Luminosity<T> where T: NumLike {
9151 type Output = InverseSolidAngle<T>;
9152 fn div(self, rhs: LuminousFlux<T>) -> Self::Output {
9153 InverseSolidAngle{per_sr: self.cd.clone() / rhs.lm}
9154 }
9155}
9156impl<T> core::ops::Div<&LuminousFlux<T>> for Luminosity<T> where T: NumLike {
9158 type Output = InverseSolidAngle<T>;
9159 fn div(self, rhs: &LuminousFlux<T>) -> Self::Output {
9160 InverseSolidAngle{per_sr: self.cd / rhs.lm.clone()}
9161 }
9162}
9163impl<T> core::ops::Div<&LuminousFlux<T>> for &Luminosity<T> where T: NumLike {
9165 type Output = InverseSolidAngle<T>;
9166 fn div(self, rhs: &LuminousFlux<T>) -> Self::Output {
9167 InverseSolidAngle{per_sr: self.cd.clone() / rhs.lm.clone()}
9168 }
9169}
9170
9171impl<T> core::ops::Div<InverseSolidAngle<T>> for Luminosity<T> where T: NumLike {
9174 type Output = LuminousFlux<T>;
9175 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
9176 LuminousFlux{lm: self.cd / rhs.per_sr}
9177 }
9178}
9179impl<T> core::ops::Div<InverseSolidAngle<T>> for &Luminosity<T> where T: NumLike {
9181 type Output = LuminousFlux<T>;
9182 fn div(self, rhs: InverseSolidAngle<T>) -> Self::Output {
9183 LuminousFlux{lm: self.cd.clone() / rhs.per_sr}
9184 }
9185}
9186impl<T> core::ops::Div<&InverseSolidAngle<T>> for Luminosity<T> where T: NumLike {
9188 type Output = LuminousFlux<T>;
9189 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
9190 LuminousFlux{lm: self.cd / rhs.per_sr.clone()}
9191 }
9192}
9193impl<T> core::ops::Div<&InverseSolidAngle<T>> for &Luminosity<T> where T: NumLike {
9195 type Output = LuminousFlux<T>;
9196 fn div(self, rhs: &InverseSolidAngle<T>) -> Self::Output {
9197 LuminousFlux{lm: self.cd.clone() / rhs.per_sr.clone()}
9198 }
9199}
9200
9201impl<T> core::ops::Mul<SolidAngle<T>> for Luminosity<T> where T: NumLike {
9204 type Output = LuminousFlux<T>;
9205 fn mul(self, rhs: SolidAngle<T>) -> Self::Output {
9206 LuminousFlux{lm: self.cd * rhs.sr}
9207 }
9208}
9209impl<T> core::ops::Mul<SolidAngle<T>> for &Luminosity<T> where T: NumLike {
9211 type Output = LuminousFlux<T>;
9212 fn mul(self, rhs: SolidAngle<T>) -> Self::Output {
9213 LuminousFlux{lm: self.cd.clone() * rhs.sr}
9214 }
9215}
9216impl<T> core::ops::Mul<&SolidAngle<T>> for Luminosity<T> where T: NumLike {
9218 type Output = LuminousFlux<T>;
9219 fn mul(self, rhs: &SolidAngle<T>) -> Self::Output {
9220 LuminousFlux{lm: self.cd * rhs.sr.clone()}
9221 }
9222}
9223impl<T> core::ops::Mul<&SolidAngle<T>> for &Luminosity<T> where T: NumLike {
9225 type Output = LuminousFlux<T>;
9226 fn mul(self, rhs: &SolidAngle<T>) -> Self::Output {
9227 LuminousFlux{lm: self.cd.clone() * rhs.sr.clone()}
9228 }
9229}
9230
9231impl<T> core::ops::Div<Luminosity<T>> for f64 where T: NumLike+From<f64> {
9234 type Output = InverseLuminosity<T>;
9235 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9236 InverseLuminosity{per_cd: T::from(self) / rhs.cd}
9237 }
9238}
9239impl<T> core::ops::Div<Luminosity<T>> for &f64 where T: NumLike+From<f64> {
9241 type Output = InverseLuminosity<T>;
9242 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9243 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd}
9244 }
9245}
9246impl<T> core::ops::Div<&Luminosity<T>> for f64 where T: NumLike+From<f64> {
9248 type Output = InverseLuminosity<T>;
9249 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9250 InverseLuminosity{per_cd: T::from(self) / rhs.cd.clone()}
9251 }
9252}
9253impl<T> core::ops::Div<&Luminosity<T>> for &f64 where T: NumLike+From<f64> {
9255 type Output = InverseLuminosity<T>;
9256 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9257 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd.clone()}
9258 }
9259}
9260
9261impl<T> core::ops::Div<Luminosity<T>> for f32 where T: NumLike+From<f32> {
9264 type Output = InverseLuminosity<T>;
9265 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9266 InverseLuminosity{per_cd: T::from(self) / rhs.cd}
9267 }
9268}
9269impl<T> core::ops::Div<Luminosity<T>> for &f32 where T: NumLike+From<f32> {
9271 type Output = InverseLuminosity<T>;
9272 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9273 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd}
9274 }
9275}
9276impl<T> core::ops::Div<&Luminosity<T>> for f32 where T: NumLike+From<f32> {
9278 type Output = InverseLuminosity<T>;
9279 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9280 InverseLuminosity{per_cd: T::from(self) / rhs.cd.clone()}
9281 }
9282}
9283impl<T> core::ops::Div<&Luminosity<T>> for &f32 where T: NumLike+From<f32> {
9285 type Output = InverseLuminosity<T>;
9286 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9287 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd.clone()}
9288 }
9289}
9290
9291impl<T> core::ops::Div<Luminosity<T>> for i64 where T: NumLike+From<i64> {
9294 type Output = InverseLuminosity<T>;
9295 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9296 InverseLuminosity{per_cd: T::from(self) / rhs.cd}
9297 }
9298}
9299impl<T> core::ops::Div<Luminosity<T>> for &i64 where T: NumLike+From<i64> {
9301 type Output = InverseLuminosity<T>;
9302 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9303 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd}
9304 }
9305}
9306impl<T> core::ops::Div<&Luminosity<T>> for i64 where T: NumLike+From<i64> {
9308 type Output = InverseLuminosity<T>;
9309 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9310 InverseLuminosity{per_cd: T::from(self) / rhs.cd.clone()}
9311 }
9312}
9313impl<T> core::ops::Div<&Luminosity<T>> for &i64 where T: NumLike+From<i64> {
9315 type Output = InverseLuminosity<T>;
9316 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9317 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd.clone()}
9318 }
9319}
9320
9321impl<T> core::ops::Div<Luminosity<T>> for i32 where T: NumLike+From<i32> {
9324 type Output = InverseLuminosity<T>;
9325 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9326 InverseLuminosity{per_cd: T::from(self) / rhs.cd}
9327 }
9328}
9329impl<T> core::ops::Div<Luminosity<T>> for &i32 where T: NumLike+From<i32> {
9331 type Output = InverseLuminosity<T>;
9332 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9333 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd}
9334 }
9335}
9336impl<T> core::ops::Div<&Luminosity<T>> for i32 where T: NumLike+From<i32> {
9338 type Output = InverseLuminosity<T>;
9339 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9340 InverseLuminosity{per_cd: T::from(self) / rhs.cd.clone()}
9341 }
9342}
9343impl<T> core::ops::Div<&Luminosity<T>> for &i32 where T: NumLike+From<i32> {
9345 type Output = InverseLuminosity<T>;
9346 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9347 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd.clone()}
9348 }
9349}
9350
9351#[cfg(feature="num-bigfloat")]
9354impl<T> core::ops::Div<Luminosity<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
9355 type Output = InverseLuminosity<T>;
9356 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9357 InverseLuminosity{per_cd: T::from(self) / rhs.cd}
9358 }
9359}
9360#[cfg(feature="num-bigfloat")]
9362impl<T> core::ops::Div<Luminosity<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
9363 type Output = InverseLuminosity<T>;
9364 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9365 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd}
9366 }
9367}
9368#[cfg(feature="num-bigfloat")]
9370impl<T> core::ops::Div<&Luminosity<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
9371 type Output = InverseLuminosity<T>;
9372 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9373 InverseLuminosity{per_cd: T::from(self) / rhs.cd.clone()}
9374 }
9375}
9376#[cfg(feature="num-bigfloat")]
9378impl<T> core::ops::Div<&Luminosity<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
9379 type Output = InverseLuminosity<T>;
9380 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9381 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd.clone()}
9382 }
9383}
9384
9385#[cfg(feature="num-complex")]
9388impl<T> core::ops::Div<Luminosity<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
9389 type Output = InverseLuminosity<T>;
9390 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9391 InverseLuminosity{per_cd: T::from(self) / rhs.cd}
9392 }
9393}
9394#[cfg(feature="num-complex")]
9396impl<T> core::ops::Div<Luminosity<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
9397 type Output = InverseLuminosity<T>;
9398 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9399 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd}
9400 }
9401}
9402#[cfg(feature="num-complex")]
9404impl<T> core::ops::Div<&Luminosity<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
9405 type Output = InverseLuminosity<T>;
9406 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9407 InverseLuminosity{per_cd: T::from(self) / rhs.cd.clone()}
9408 }
9409}
9410#[cfg(feature="num-complex")]
9412impl<T> core::ops::Div<&Luminosity<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
9413 type Output = InverseLuminosity<T>;
9414 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9415 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd.clone()}
9416 }
9417}
9418
9419#[cfg(feature="num-complex")]
9422impl<T> core::ops::Div<Luminosity<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
9423 type Output = InverseLuminosity<T>;
9424 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9425 InverseLuminosity{per_cd: T::from(self) / rhs.cd}
9426 }
9427}
9428#[cfg(feature="num-complex")]
9430impl<T> core::ops::Div<Luminosity<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
9431 type Output = InverseLuminosity<T>;
9432 fn div(self, rhs: Luminosity<T>) -> Self::Output {
9433 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd}
9434 }
9435}
9436#[cfg(feature="num-complex")]
9438impl<T> core::ops::Div<&Luminosity<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
9439 type Output = InverseLuminosity<T>;
9440 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9441 InverseLuminosity{per_cd: T::from(self) / rhs.cd.clone()}
9442 }
9443}
9444#[cfg(feature="num-complex")]
9446impl<T> core::ops::Div<&Luminosity<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
9447 type Output = InverseLuminosity<T>;
9448 fn div(self, rhs: &Luminosity<T>) -> Self::Output {
9449 InverseLuminosity{per_cd: T::from(self.clone()) / rhs.cd.clone()}
9450 }
9451}
9452
9453#[derive(UnitStruct, Debug, Clone)]
9455#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
9456pub struct Mass<T: NumLike>{
9457 pub kg: T
9459}
9460
9461impl<T> Mass<T> where T: NumLike {
9462
9463 pub fn unit_name() -> &'static str { "kilograms" }
9465
9466 pub fn unit_symbol() -> &'static str { "kg" }
9468
9469 pub fn from_kg(kg: T) -> Self { Mass{kg: kg} }
9474
9475 pub fn to_kg(&self) -> T { self.kg.clone() }
9477
9478 pub fn from_kilograms(kilograms: T) -> Self { Mass{kg: kilograms} }
9483
9484 pub fn to_kilograms(&self) -> T { self.kg.clone() }
9486
9487}
9488
9489impl<T> fmt::Display for Mass<T> where T: NumLike {
9490 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9491 write!(f, "{} {}", &self.kg, Self::unit_symbol())
9492 }
9493}
9494
9495impl<T> Mass<T> where T: NumLike+From<f64> {
9496
9497 pub fn to_g(&self) -> T {
9501 return self.kg.clone() * T::from(1000.0_f64);
9502 }
9503
9504 pub fn from_g(g: T) -> Self {
9511 Mass{kg: g * T::from(0.001_f64)}
9512 }
9513
9514 pub fn to_mg(&self) -> T {
9518 return self.kg.clone() * T::from(1000000.0_f64);
9519 }
9520
9521 pub fn from_mg(mg: T) -> Self {
9528 Mass{kg: mg * T::from(1e-06_f64)}
9529 }
9530
9531 pub fn to_ug(&self) -> T {
9535 return self.kg.clone() * T::from(1000000000.0_f64);
9536 }
9537
9538 pub fn from_ug(ug: T) -> Self {
9545 Mass{kg: ug * T::from(1e-09_f64)}
9546 }
9547
9548 pub fn to_ng(&self) -> T {
9552 return self.kg.clone() * T::from(1000000000000.0_f64);
9553 }
9554
9555 pub fn from_ng(ng: T) -> Self {
9562 Mass{kg: ng * T::from(1e-12_f64)}
9563 }
9564
9565 pub fn to_pg(&self) -> T {
9569 return self.kg.clone() * T::from(1000000000000000.0_f64);
9570 }
9571
9572 pub fn from_pg(pg: T) -> Self {
9579 Mass{kg: pg * T::from(1e-15_f64)}
9580 }
9581
9582 pub fn to_tons(&self) -> T {
9586 return self.kg.clone() * T::from(0.001_f64);
9587 }
9588
9589 pub fn from_tons(tons: T) -> Self {
9596 Mass{kg: tons * T::from(1000.0_f64)}
9597 }
9598
9599 pub fn to_earth_mass(&self) -> T {
9603 return self.kg.clone() * T::from(1.6744248350691502e-25_f64);
9604 }
9605
9606 pub fn from_earth_mass(earth_mass: T) -> Self {
9613 Mass{kg: earth_mass * T::from(5.9722e+24_f64)}
9614 }
9615
9616 pub fn to_jupiter_mass(&self) -> T {
9620 return self.kg.clone() * T::from(5.26703887074687e-28_f64);
9621 }
9622
9623 pub fn from_jupiter_mass(jupiter_mass: T) -> Self {
9630 Mass{kg: jupiter_mass * T::from(1.8986e+27_f64)}
9631 }
9632
9633 pub fn to_solar_mass(&self) -> T {
9637 return self.kg.clone() * T::from(5.0287898217294e-31_f64);
9638 }
9639
9640 pub fn from_solar_mass(solar_mass: T) -> Self {
9647 Mass{kg: solar_mass * T::from(1.9885500000000002e+30_f64)}
9648 }
9649
9650}
9651
9652
9653#[cfg(feature="num-bigfloat")]
9655impl core::ops::Mul<Mass<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
9656 type Output = Mass<num_bigfloat::BigFloat>;
9657 fn mul(self, rhs: Mass<num_bigfloat::BigFloat>) -> Self::Output {
9658 Mass{kg: self * rhs.kg}
9659 }
9660}
9661#[cfg(feature="num-bigfloat")]
9663impl core::ops::Mul<Mass<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
9664 type Output = Mass<num_bigfloat::BigFloat>;
9665 fn mul(self, rhs: Mass<num_bigfloat::BigFloat>) -> Self::Output {
9666 Mass{kg: self.clone() * rhs.kg}
9667 }
9668}
9669#[cfg(feature="num-bigfloat")]
9671impl core::ops::Mul<&Mass<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
9672 type Output = Mass<num_bigfloat::BigFloat>;
9673 fn mul(self, rhs: &Mass<num_bigfloat::BigFloat>) -> Self::Output {
9674 Mass{kg: self * rhs.kg.clone()}
9675 }
9676}
9677#[cfg(feature="num-bigfloat")]
9679impl core::ops::Mul<&Mass<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
9680 type Output = Mass<num_bigfloat::BigFloat>;
9681 fn mul(self, rhs: &Mass<num_bigfloat::BigFloat>) -> Self::Output {
9682 Mass{kg: self.clone() * rhs.kg.clone()}
9683 }
9684}
9685
9686#[cfg(feature="num-complex")]
9688impl core::ops::Mul<Mass<num_complex::Complex32>> for num_complex::Complex32 {
9689 type Output = Mass<num_complex::Complex32>;
9690 fn mul(self, rhs: Mass<num_complex::Complex32>) -> Self::Output {
9691 Mass{kg: self * rhs.kg}
9692 }
9693}
9694#[cfg(feature="num-complex")]
9696impl core::ops::Mul<Mass<num_complex::Complex32>> for &num_complex::Complex32 {
9697 type Output = Mass<num_complex::Complex32>;
9698 fn mul(self, rhs: Mass<num_complex::Complex32>) -> Self::Output {
9699 Mass{kg: self.clone() * rhs.kg}
9700 }
9701}
9702#[cfg(feature="num-complex")]
9704impl core::ops::Mul<&Mass<num_complex::Complex32>> for num_complex::Complex32 {
9705 type Output = Mass<num_complex::Complex32>;
9706 fn mul(self, rhs: &Mass<num_complex::Complex32>) -> Self::Output {
9707 Mass{kg: self * rhs.kg.clone()}
9708 }
9709}
9710#[cfg(feature="num-complex")]
9712impl core::ops::Mul<&Mass<num_complex::Complex32>> for &num_complex::Complex32 {
9713 type Output = Mass<num_complex::Complex32>;
9714 fn mul(self, rhs: &Mass<num_complex::Complex32>) -> Self::Output {
9715 Mass{kg: self.clone() * rhs.kg.clone()}
9716 }
9717}
9718
9719#[cfg(feature="num-complex")]
9721impl core::ops::Mul<Mass<num_complex::Complex64>> for num_complex::Complex64 {
9722 type Output = Mass<num_complex::Complex64>;
9723 fn mul(self, rhs: Mass<num_complex::Complex64>) -> Self::Output {
9724 Mass{kg: self * rhs.kg}
9725 }
9726}
9727#[cfg(feature="num-complex")]
9729impl core::ops::Mul<Mass<num_complex::Complex64>> for &num_complex::Complex64 {
9730 type Output = Mass<num_complex::Complex64>;
9731 fn mul(self, rhs: Mass<num_complex::Complex64>) -> Self::Output {
9732 Mass{kg: self.clone() * rhs.kg}
9733 }
9734}
9735#[cfg(feature="num-complex")]
9737impl core::ops::Mul<&Mass<num_complex::Complex64>> for num_complex::Complex64 {
9738 type Output = Mass<num_complex::Complex64>;
9739 fn mul(self, rhs: &Mass<num_complex::Complex64>) -> Self::Output {
9740 Mass{kg: self * rhs.kg.clone()}
9741 }
9742}
9743#[cfg(feature="num-complex")]
9745impl core::ops::Mul<&Mass<num_complex::Complex64>> for &num_complex::Complex64 {
9746 type Output = Mass<num_complex::Complex64>;
9747 fn mul(self, rhs: &Mass<num_complex::Complex64>) -> Self::Output {
9748 Mass{kg: self.clone() * rhs.kg.clone()}
9749 }
9750}
9751
9752
9753
9754#[cfg(feature = "uom")]
9756impl<T> Into<uom::si::f32::Mass> for Mass<T> where T: NumLike+Into<f32> {
9757 fn into(self) -> uom::si::f32::Mass {
9758 uom::si::f32::Mass::new::<uom::si::mass::kilogram>(self.kg.into())
9759 }
9760}
9761
9762#[cfg(feature = "uom")]
9764impl<T> From<uom::si::f32::Mass> for Mass<T> where T: NumLike+From<f32> {
9765 fn from(src: uom::si::f32::Mass) -> Self {
9766 Mass{kg: T::from(src.value)}
9767 }
9768}
9769
9770#[cfg(feature = "uom")]
9772impl<T> Into<uom::si::f64::Mass> for Mass<T> where T: NumLike+Into<f64> {
9773 fn into(self) -> uom::si::f64::Mass {
9774 uom::si::f64::Mass::new::<uom::si::mass::kilogram>(self.kg.into())
9775 }
9776}
9777
9778#[cfg(feature = "uom")]
9780impl<T> From<uom::si::f64::Mass> for Mass<T> where T: NumLike+From<f64> {
9781 fn from(src: uom::si::f64::Mass) -> Self {
9782 Mass{kg: T::from(src.value)}
9783 }
9784}
9785
9786
9787impl<T> core::ops::Div<Amount<T>> for Mass<T> where T: NumLike {
9790 type Output = MolarMass<T>;
9791 fn div(self, rhs: Amount<T>) -> Self::Output {
9792 MolarMass{kgpmol: self.kg / rhs.mol}
9793 }
9794}
9795impl<T> core::ops::Div<Amount<T>> for &Mass<T> where T: NumLike {
9797 type Output = MolarMass<T>;
9798 fn div(self, rhs: Amount<T>) -> Self::Output {
9799 MolarMass{kgpmol: self.kg.clone() / rhs.mol}
9800 }
9801}
9802impl<T> core::ops::Div<&Amount<T>> for Mass<T> where T: NumLike {
9804 type Output = MolarMass<T>;
9805 fn div(self, rhs: &Amount<T>) -> Self::Output {
9806 MolarMass{kgpmol: self.kg / rhs.mol.clone()}
9807 }
9808}
9809impl<T> core::ops::Div<&Amount<T>> for &Mass<T> where T: NumLike {
9811 type Output = MolarMass<T>;
9812 fn div(self, rhs: &Amount<T>) -> Self::Output {
9813 MolarMass{kgpmol: self.kg.clone() / rhs.mol.clone()}
9814 }
9815}
9816
9817impl<T> core::ops::Mul<InverseAmount<T>> for Mass<T> where T: NumLike {
9820 type Output = MolarMass<T>;
9821 fn mul(self, rhs: InverseAmount<T>) -> Self::Output {
9822 MolarMass{kgpmol: self.kg * rhs.per_mol}
9823 }
9824}
9825impl<T> core::ops::Mul<InverseAmount<T>> for &Mass<T> where T: NumLike {
9827 type Output = MolarMass<T>;
9828 fn mul(self, rhs: InverseAmount<T>) -> Self::Output {
9829 MolarMass{kgpmol: self.kg.clone() * rhs.per_mol}
9830 }
9831}
9832impl<T> core::ops::Mul<&InverseAmount<T>> for Mass<T> where T: NumLike {
9834 type Output = MolarMass<T>;
9835 fn mul(self, rhs: &InverseAmount<T>) -> Self::Output {
9836 MolarMass{kgpmol: self.kg * rhs.per_mol.clone()}
9837 }
9838}
9839impl<T> core::ops::Mul<&InverseAmount<T>> for &Mass<T> where T: NumLike {
9841 type Output = MolarMass<T>;
9842 fn mul(self, rhs: &InverseAmount<T>) -> Self::Output {
9843 MolarMass{kgpmol: self.kg.clone() * rhs.per_mol.clone()}
9844 }
9845}
9846
9847impl<T> core::ops::Mul<Molality<T>> for Mass<T> where T: NumLike {
9850 type Output = Amount<T>;
9851 fn mul(self, rhs: Molality<T>) -> Self::Output {
9852 Amount{mol: self.kg * rhs.molpkg}
9853 }
9854}
9855impl<T> core::ops::Mul<Molality<T>> for &Mass<T> where T: NumLike {
9857 type Output = Amount<T>;
9858 fn mul(self, rhs: Molality<T>) -> Self::Output {
9859 Amount{mol: self.kg.clone() * rhs.molpkg}
9860 }
9861}
9862impl<T> core::ops::Mul<&Molality<T>> for Mass<T> where T: NumLike {
9864 type Output = Amount<T>;
9865 fn mul(self, rhs: &Molality<T>) -> Self::Output {
9866 Amount{mol: self.kg * rhs.molpkg.clone()}
9867 }
9868}
9869impl<T> core::ops::Mul<&Molality<T>> for &Mass<T> where T: NumLike {
9871 type Output = Amount<T>;
9872 fn mul(self, rhs: &Molality<T>) -> Self::Output {
9873 Amount{mol: self.kg.clone() * rhs.molpkg.clone()}
9874 }
9875}
9876
9877impl<T> core::ops::Div<MolarMass<T>> for Mass<T> where T: NumLike {
9880 type Output = Amount<T>;
9881 fn div(self, rhs: MolarMass<T>) -> Self::Output {
9882 Amount{mol: self.kg / rhs.kgpmol}
9883 }
9884}
9885impl<T> core::ops::Div<MolarMass<T>> for &Mass<T> where T: NumLike {
9887 type Output = Amount<T>;
9888 fn div(self, rhs: MolarMass<T>) -> Self::Output {
9889 Amount{mol: self.kg.clone() / rhs.kgpmol}
9890 }
9891}
9892impl<T> core::ops::Div<&MolarMass<T>> for Mass<T> where T: NumLike {
9894 type Output = Amount<T>;
9895 fn div(self, rhs: &MolarMass<T>) -> Self::Output {
9896 Amount{mol: self.kg / rhs.kgpmol.clone()}
9897 }
9898}
9899impl<T> core::ops::Div<&MolarMass<T>> for &Mass<T> where T: NumLike {
9901 type Output = Amount<T>;
9902 fn div(self, rhs: &MolarMass<T>) -> Self::Output {
9903 Amount{mol: self.kg.clone() / rhs.kgpmol.clone()}
9904 }
9905}
9906
9907impl<T> core::ops::Div<Area<T>> for Mass<T> where T: NumLike {
9910 type Output = AreaDensity<T>;
9911 fn div(self, rhs: Area<T>) -> Self::Output {
9912 AreaDensity{kgpm2: self.kg / rhs.m2}
9913 }
9914}
9915impl<T> core::ops::Div<Area<T>> for &Mass<T> where T: NumLike {
9917 type Output = AreaDensity<T>;
9918 fn div(self, rhs: Area<T>) -> Self::Output {
9919 AreaDensity{kgpm2: self.kg.clone() / rhs.m2}
9920 }
9921}
9922impl<T> core::ops::Div<&Area<T>> for Mass<T> where T: NumLike {
9924 type Output = AreaDensity<T>;
9925 fn div(self, rhs: &Area<T>) -> Self::Output {
9926 AreaDensity{kgpm2: self.kg / rhs.m2.clone()}
9927 }
9928}
9929impl<T> core::ops::Div<&Area<T>> for &Mass<T> where T: NumLike {
9931 type Output = AreaDensity<T>;
9932 fn div(self, rhs: &Area<T>) -> Self::Output {
9933 AreaDensity{kgpm2: self.kg.clone() / rhs.m2.clone()}
9934 }
9935}
9936
9937impl<T> core::ops::Mul<InverseArea<T>> for Mass<T> where T: NumLike {
9940 type Output = AreaDensity<T>;
9941 fn mul(self, rhs: InverseArea<T>) -> Self::Output {
9942 AreaDensity{kgpm2: self.kg * rhs.per_m2}
9943 }
9944}
9945impl<T> core::ops::Mul<InverseArea<T>> for &Mass<T> where T: NumLike {
9947 type Output = AreaDensity<T>;
9948 fn mul(self, rhs: InverseArea<T>) -> Self::Output {
9949 AreaDensity{kgpm2: self.kg.clone() * rhs.per_m2}
9950 }
9951}
9952impl<T> core::ops::Mul<&InverseArea<T>> for Mass<T> where T: NumLike {
9954 type Output = AreaDensity<T>;
9955 fn mul(self, rhs: &InverseArea<T>) -> Self::Output {
9956 AreaDensity{kgpm2: self.kg * rhs.per_m2.clone()}
9957 }
9958}
9959impl<T> core::ops::Mul<&InverseArea<T>> for &Mass<T> where T: NumLike {
9961 type Output = AreaDensity<T>;
9962 fn mul(self, rhs: &InverseArea<T>) -> Self::Output {
9963 AreaDensity{kgpm2: self.kg.clone() * rhs.per_m2.clone()}
9964 }
9965}
9966
9967impl<T> core::ops::Mul<InverseVolume<T>> for Mass<T> where T: NumLike {
9970 type Output = Density<T>;
9971 fn mul(self, rhs: InverseVolume<T>) -> Self::Output {
9972 Density{kgpm3: self.kg * rhs.per_m3}
9973 }
9974}
9975impl<T> core::ops::Mul<InverseVolume<T>> for &Mass<T> where T: NumLike {
9977 type Output = Density<T>;
9978 fn mul(self, rhs: InverseVolume<T>) -> Self::Output {
9979 Density{kgpm3: self.kg.clone() * rhs.per_m3}
9980 }
9981}
9982impl<T> core::ops::Mul<&InverseVolume<T>> for Mass<T> where T: NumLike {
9984 type Output = Density<T>;
9985 fn mul(self, rhs: &InverseVolume<T>) -> Self::Output {
9986 Density{kgpm3: self.kg * rhs.per_m3.clone()}
9987 }
9988}
9989impl<T> core::ops::Mul<&InverseVolume<T>> for &Mass<T> where T: NumLike {
9991 type Output = Density<T>;
9992 fn mul(self, rhs: &InverseVolume<T>) -> Self::Output {
9993 Density{kgpm3: self.kg.clone() * rhs.per_m3.clone()}
9994 }
9995}
9996
9997impl<T> core::ops::Div<Volume<T>> for Mass<T> where T: NumLike {
10000 type Output = Density<T>;
10001 fn div(self, rhs: Volume<T>) -> Self::Output {
10002 Density{kgpm3: self.kg / rhs.m3}
10003 }
10004}
10005impl<T> core::ops::Div<Volume<T>> for &Mass<T> where T: NumLike {
10007 type Output = Density<T>;
10008 fn div(self, rhs: Volume<T>) -> Self::Output {
10009 Density{kgpm3: self.kg.clone() / rhs.m3}
10010 }
10011}
10012impl<T> core::ops::Div<&Volume<T>> for Mass<T> where T: NumLike {
10014 type Output = Density<T>;
10015 fn div(self, rhs: &Volume<T>) -> Self::Output {
10016 Density{kgpm3: self.kg / rhs.m3.clone()}
10017 }
10018}
10019impl<T> core::ops::Div<&Volume<T>> for &Mass<T> where T: NumLike {
10021 type Output = Density<T>;
10022 fn div(self, rhs: &Volume<T>) -> Self::Output {
10023 Density{kgpm3: self.kg.clone() / rhs.m3.clone()}
10024 }
10025}
10026
10027impl<T> core::ops::Mul<Acceleration<T>> for Mass<T> where T: NumLike {
10030 type Output = Force<T>;
10031 fn mul(self, rhs: Acceleration<T>) -> Self::Output {
10032 Force{N: self.kg * rhs.mps2}
10033 }
10034}
10035impl<T> core::ops::Mul<Acceleration<T>> for &Mass<T> where T: NumLike {
10037 type Output = Force<T>;
10038 fn mul(self, rhs: Acceleration<T>) -> Self::Output {
10039 Force{N: self.kg.clone() * rhs.mps2}
10040 }
10041}
10042impl<T> core::ops::Mul<&Acceleration<T>> for Mass<T> where T: NumLike {
10044 type Output = Force<T>;
10045 fn mul(self, rhs: &Acceleration<T>) -> Self::Output {
10046 Force{N: self.kg * rhs.mps2.clone()}
10047 }
10048}
10049impl<T> core::ops::Mul<&Acceleration<T>> for &Mass<T> where T: NumLike {
10051 type Output = Force<T>;
10052 fn mul(self, rhs: &Acceleration<T>) -> Self::Output {
10053 Force{N: self.kg.clone() * rhs.mps2.clone()}
10054 }
10055}
10056
10057impl<T> core::ops::Div<AreaDensity<T>> for Mass<T> where T: NumLike {
10060 type Output = Area<T>;
10061 fn div(self, rhs: AreaDensity<T>) -> Self::Output {
10062 Area{m2: self.kg / rhs.kgpm2}
10063 }
10064}
10065impl<T> core::ops::Div<AreaDensity<T>> for &Mass<T> where T: NumLike {
10067 type Output = Area<T>;
10068 fn div(self, rhs: AreaDensity<T>) -> Self::Output {
10069 Area{m2: self.kg.clone() / rhs.kgpm2}
10070 }
10071}
10072impl<T> core::ops::Div<&AreaDensity<T>> for Mass<T> where T: NumLike {
10074 type Output = Area<T>;
10075 fn div(self, rhs: &AreaDensity<T>) -> Self::Output {
10076 Area{m2: self.kg / rhs.kgpm2.clone()}
10077 }
10078}
10079impl<T> core::ops::Div<&AreaDensity<T>> for &Mass<T> where T: NumLike {
10081 type Output = Area<T>;
10082 fn div(self, rhs: &AreaDensity<T>) -> Self::Output {
10083 Area{m2: self.kg.clone() / rhs.kgpm2.clone()}
10084 }
10085}
10086
10087impl<T> core::ops::Mul<AreaPerMass<T>> for Mass<T> where T: NumLike {
10090 type Output = Area<T>;
10091 fn mul(self, rhs: AreaPerMass<T>) -> Self::Output {
10092 Area{m2: self.kg * rhs.m2_per_kg}
10093 }
10094}
10095impl<T> core::ops::Mul<AreaPerMass<T>> for &Mass<T> where T: NumLike {
10097 type Output = Area<T>;
10098 fn mul(self, rhs: AreaPerMass<T>) -> Self::Output {
10099 Area{m2: self.kg.clone() * rhs.m2_per_kg}
10100 }
10101}
10102impl<T> core::ops::Mul<&AreaPerMass<T>> for Mass<T> where T: NumLike {
10104 type Output = Area<T>;
10105 fn mul(self, rhs: &AreaPerMass<T>) -> Self::Output {
10106 Area{m2: self.kg * rhs.m2_per_kg.clone()}
10107 }
10108}
10109impl<T> core::ops::Mul<&AreaPerMass<T>> for &Mass<T> where T: NumLike {
10111 type Output = Area<T>;
10112 fn mul(self, rhs: &AreaPerMass<T>) -> Self::Output {
10113 Area{m2: self.kg.clone() * rhs.m2_per_kg.clone()}
10114 }
10115}
10116
10117impl<T> core::ops::Div<Density<T>> for Mass<T> where T: NumLike {
10120 type Output = Volume<T>;
10121 fn div(self, rhs: Density<T>) -> Self::Output {
10122 Volume{m3: self.kg / rhs.kgpm3}
10123 }
10124}
10125impl<T> core::ops::Div<Density<T>> for &Mass<T> where T: NumLike {
10127 type Output = Volume<T>;
10128 fn div(self, rhs: Density<T>) -> Self::Output {
10129 Volume{m3: self.kg.clone() / rhs.kgpm3}
10130 }
10131}
10132impl<T> core::ops::Div<&Density<T>> for Mass<T> where T: NumLike {
10134 type Output = Volume<T>;
10135 fn div(self, rhs: &Density<T>) -> Self::Output {
10136 Volume{m3: self.kg / rhs.kgpm3.clone()}
10137 }
10138}
10139impl<T> core::ops::Div<&Density<T>> for &Mass<T> where T: NumLike {
10141 type Output = Volume<T>;
10142 fn div(self, rhs: &Density<T>) -> Self::Output {
10143 Volume{m3: self.kg.clone() / rhs.kgpm3.clone()}
10144 }
10145}
10146
10147impl<T> core::ops::Div<Force<T>> for Mass<T> where T: NumLike {
10150 type Output = InverseAcceleration<T>;
10151 fn div(self, rhs: Force<T>) -> Self::Output {
10152 InverseAcceleration{s2pm: self.kg / rhs.N}
10153 }
10154}
10155impl<T> core::ops::Div<Force<T>> for &Mass<T> where T: NumLike {
10157 type Output = InverseAcceleration<T>;
10158 fn div(self, rhs: Force<T>) -> Self::Output {
10159 InverseAcceleration{s2pm: self.kg.clone() / rhs.N}
10160 }
10161}
10162impl<T> core::ops::Div<&Force<T>> for Mass<T> where T: NumLike {
10164 type Output = InverseAcceleration<T>;
10165 fn div(self, rhs: &Force<T>) -> Self::Output {
10166 InverseAcceleration{s2pm: self.kg / rhs.N.clone()}
10167 }
10168}
10169impl<T> core::ops::Div<&Force<T>> for &Mass<T> where T: NumLike {
10171 type Output = InverseAcceleration<T>;
10172 fn div(self, rhs: &Force<T>) -> Self::Output {
10173 InverseAcceleration{s2pm: self.kg.clone() / rhs.N.clone()}
10174 }
10175}
10176
10177impl<T> core::ops::Div<InverseAcceleration<T>> for Mass<T> where T: NumLike {
10180 type Output = Force<T>;
10181 fn div(self, rhs: InverseAcceleration<T>) -> Self::Output {
10182 Force{N: self.kg / rhs.s2pm}
10183 }
10184}
10185impl<T> core::ops::Div<InverseAcceleration<T>> for &Mass<T> where T: NumLike {
10187 type Output = Force<T>;
10188 fn div(self, rhs: InverseAcceleration<T>) -> Self::Output {
10189 Force{N: self.kg.clone() / rhs.s2pm}
10190 }
10191}
10192impl<T> core::ops::Div<&InverseAcceleration<T>> for Mass<T> where T: NumLike {
10194 type Output = Force<T>;
10195 fn div(self, rhs: &InverseAcceleration<T>) -> Self::Output {
10196 Force{N: self.kg / rhs.s2pm.clone()}
10197 }
10198}
10199impl<T> core::ops::Div<&InverseAcceleration<T>> for &Mass<T> where T: NumLike {
10201 type Output = Force<T>;
10202 fn div(self, rhs: &InverseAcceleration<T>) -> Self::Output {
10203 Force{N: self.kg.clone() / rhs.s2pm.clone()}
10204 }
10205}
10206
10207impl<T> core::ops::Mul<InverseForce<T>> for Mass<T> where T: NumLike {
10210 type Output = InverseAcceleration<T>;
10211 fn mul(self, rhs: InverseForce<T>) -> Self::Output {
10212 InverseAcceleration{s2pm: self.kg * rhs.per_N}
10213 }
10214}
10215impl<T> core::ops::Mul<InverseForce<T>> for &Mass<T> where T: NumLike {
10217 type Output = InverseAcceleration<T>;
10218 fn mul(self, rhs: InverseForce<T>) -> Self::Output {
10219 InverseAcceleration{s2pm: self.kg.clone() * rhs.per_N}
10220 }
10221}
10222impl<T> core::ops::Mul<&InverseForce<T>> for Mass<T> where T: NumLike {
10224 type Output = InverseAcceleration<T>;
10225 fn mul(self, rhs: &InverseForce<T>) -> Self::Output {
10226 InverseAcceleration{s2pm: self.kg * rhs.per_N.clone()}
10227 }
10228}
10229impl<T> core::ops::Mul<&InverseForce<T>> for &Mass<T> where T: NumLike {
10231 type Output = InverseAcceleration<T>;
10232 fn mul(self, rhs: &InverseForce<T>) -> Self::Output {
10233 InverseAcceleration{s2pm: self.kg.clone() * rhs.per_N.clone()}
10234 }
10235}
10236
10237impl<T> core::ops::Mul<InverseMomentOfInertia<T>> for Mass<T> where T: NumLike {
10240 type Output = InverseArea<T>;
10241 fn mul(self, rhs: InverseMomentOfInertia<T>) -> Self::Output {
10242 InverseArea{per_m2: self.kg * rhs.per_kgm2}
10243 }
10244}
10245impl<T> core::ops::Mul<InverseMomentOfInertia<T>> for &Mass<T> where T: NumLike {
10247 type Output = InverseArea<T>;
10248 fn mul(self, rhs: InverseMomentOfInertia<T>) -> Self::Output {
10249 InverseArea{per_m2: self.kg.clone() * rhs.per_kgm2}
10250 }
10251}
10252impl<T> core::ops::Mul<&InverseMomentOfInertia<T>> for Mass<T> where T: NumLike {
10254 type Output = InverseArea<T>;
10255 fn mul(self, rhs: &InverseMomentOfInertia<T>) -> Self::Output {
10256 InverseArea{per_m2: self.kg * rhs.per_kgm2.clone()}
10257 }
10258}
10259impl<T> core::ops::Mul<&InverseMomentOfInertia<T>> for &Mass<T> where T: NumLike {
10261 type Output = InverseArea<T>;
10262 fn mul(self, rhs: &InverseMomentOfInertia<T>) -> Self::Output {
10263 InverseArea{per_m2: self.kg.clone() * rhs.per_kgm2.clone()}
10264 }
10265}
10266
10267impl<T> core::ops::Mul<InverseMomentum<T>> for Mass<T> where T: NumLike {
10270 type Output = TimePerDistance<T>;
10271 fn mul(self, rhs: InverseMomentum<T>) -> Self::Output {
10272 TimePerDistance{spm: self.kg * rhs.s_per_kgm}
10273 }
10274}
10275impl<T> core::ops::Mul<InverseMomentum<T>> for &Mass<T> where T: NumLike {
10277 type Output = TimePerDistance<T>;
10278 fn mul(self, rhs: InverseMomentum<T>) -> Self::Output {
10279 TimePerDistance{spm: self.kg.clone() * rhs.s_per_kgm}
10280 }
10281}
10282impl<T> core::ops::Mul<&InverseMomentum<T>> for Mass<T> where T: NumLike {
10284 type Output = TimePerDistance<T>;
10285 fn mul(self, rhs: &InverseMomentum<T>) -> Self::Output {
10286 TimePerDistance{spm: self.kg * rhs.s_per_kgm.clone()}
10287 }
10288}
10289impl<T> core::ops::Mul<&InverseMomentum<T>> for &Mass<T> where T: NumLike {
10291 type Output = TimePerDistance<T>;
10292 fn mul(self, rhs: &InverseMomentum<T>) -> Self::Output {
10293 TimePerDistance{spm: self.kg.clone() * rhs.s_per_kgm.clone()}
10294 }
10295}
10296
10297impl<T> core::ops::Div<MomentOfInertia<T>> for Mass<T> where T: NumLike {
10300 type Output = InverseArea<T>;
10301 fn div(self, rhs: MomentOfInertia<T>) -> Self::Output {
10302 InverseArea{per_m2: self.kg / rhs.kgm2}
10303 }
10304}
10305impl<T> core::ops::Div<MomentOfInertia<T>> for &Mass<T> where T: NumLike {
10307 type Output = InverseArea<T>;
10308 fn div(self, rhs: MomentOfInertia<T>) -> Self::Output {
10309 InverseArea{per_m2: self.kg.clone() / rhs.kgm2}
10310 }
10311}
10312impl<T> core::ops::Div<&MomentOfInertia<T>> for Mass<T> where T: NumLike {
10314 type Output = InverseArea<T>;
10315 fn div(self, rhs: &MomentOfInertia<T>) -> Self::Output {
10316 InverseArea{per_m2: self.kg / rhs.kgm2.clone()}
10317 }
10318}
10319impl<T> core::ops::Div<&MomentOfInertia<T>> for &Mass<T> where T: NumLike {
10321 type Output = InverseArea<T>;
10322 fn div(self, rhs: &MomentOfInertia<T>) -> Self::Output {
10323 InverseArea{per_m2: self.kg.clone() / rhs.kgm2.clone()}
10324 }
10325}
10326
10327impl<T> core::ops::Div<Momentum<T>> for Mass<T> where T: NumLike {
10330 type Output = TimePerDistance<T>;
10331 fn div(self, rhs: Momentum<T>) -> Self::Output {
10332 TimePerDistance{spm: self.kg / rhs.kgmps}
10333 }
10334}
10335impl<T> core::ops::Div<Momentum<T>> for &Mass<T> where T: NumLike {
10337 type Output = TimePerDistance<T>;
10338 fn div(self, rhs: Momentum<T>) -> Self::Output {
10339 TimePerDistance{spm: self.kg.clone() / rhs.kgmps}
10340 }
10341}
10342impl<T> core::ops::Div<&Momentum<T>> for Mass<T> where T: NumLike {
10344 type Output = TimePerDistance<T>;
10345 fn div(self, rhs: &Momentum<T>) -> Self::Output {
10346 TimePerDistance{spm: self.kg / rhs.kgmps.clone()}
10347 }
10348}
10349impl<T> core::ops::Div<&Momentum<T>> for &Mass<T> where T: NumLike {
10351 type Output = TimePerDistance<T>;
10352 fn div(self, rhs: &Momentum<T>) -> Self::Output {
10353 TimePerDistance{spm: self.kg.clone() / rhs.kgmps.clone()}
10354 }
10355}
10356
10357impl<T> core::ops::Div<TimePerDistance<T>> for Mass<T> where T: NumLike {
10360 type Output = Momentum<T>;
10361 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
10362 Momentum{kgmps: self.kg / rhs.spm}
10363 }
10364}
10365impl<T> core::ops::Div<TimePerDistance<T>> for &Mass<T> where T: NumLike {
10367 type Output = Momentum<T>;
10368 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
10369 Momentum{kgmps: self.kg.clone() / rhs.spm}
10370 }
10371}
10372impl<T> core::ops::Div<&TimePerDistance<T>> for Mass<T> where T: NumLike {
10374 type Output = Momentum<T>;
10375 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
10376 Momentum{kgmps: self.kg / rhs.spm.clone()}
10377 }
10378}
10379impl<T> core::ops::Div<&TimePerDistance<T>> for &Mass<T> where T: NumLike {
10381 type Output = Momentum<T>;
10382 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
10383 Momentum{kgmps: self.kg.clone() / rhs.spm.clone()}
10384 }
10385}
10386
10387impl<T> core::ops::Mul<Velocity<T>> for Mass<T> where T: NumLike {
10390 type Output = Momentum<T>;
10391 fn mul(self, rhs: Velocity<T>) -> Self::Output {
10392 Momentum{kgmps: self.kg * rhs.mps}
10393 }
10394}
10395impl<T> core::ops::Mul<Velocity<T>> for &Mass<T> where T: NumLike {
10397 type Output = Momentum<T>;
10398 fn mul(self, rhs: Velocity<T>) -> Self::Output {
10399 Momentum{kgmps: self.kg.clone() * rhs.mps}
10400 }
10401}
10402impl<T> core::ops::Mul<&Velocity<T>> for Mass<T> where T: NumLike {
10404 type Output = Momentum<T>;
10405 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
10406 Momentum{kgmps: self.kg * rhs.mps.clone()}
10407 }
10408}
10409impl<T> core::ops::Mul<&Velocity<T>> for &Mass<T> where T: NumLike {
10411 type Output = Momentum<T>;
10412 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
10413 Momentum{kgmps: self.kg.clone() * rhs.mps.clone()}
10414 }
10415}
10416
10417impl<T> core::ops::Mul<VolumePerMass<T>> for Mass<T> where T: NumLike {
10420 type Output = Volume<T>;
10421 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
10422 Volume{m3: self.kg * rhs.m3_per_kg}
10423 }
10424}
10425impl<T> core::ops::Mul<VolumePerMass<T>> for &Mass<T> where T: NumLike {
10427 type Output = Volume<T>;
10428 fn mul(self, rhs: VolumePerMass<T>) -> Self::Output {
10429 Volume{m3: self.kg.clone() * rhs.m3_per_kg}
10430 }
10431}
10432impl<T> core::ops::Mul<&VolumePerMass<T>> for Mass<T> where T: NumLike {
10434 type Output = Volume<T>;
10435 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
10436 Volume{m3: self.kg * rhs.m3_per_kg.clone()}
10437 }
10438}
10439impl<T> core::ops::Mul<&VolumePerMass<T>> for &Mass<T> where T: NumLike {
10441 type Output = Volume<T>;
10442 fn mul(self, rhs: &VolumePerMass<T>) -> Self::Output {
10443 Volume{m3: self.kg.clone() * rhs.m3_per_kg.clone()}
10444 }
10445}
10446
10447impl<T> core::ops::Mul<AbsorbedDose<T>> for Mass<T> where T: NumLike {
10450 type Output = Energy<T>;
10451 fn mul(self, rhs: AbsorbedDose<T>) -> Self::Output {
10452 Energy{J: self.kg * rhs.Gy}
10453 }
10454}
10455impl<T> core::ops::Mul<AbsorbedDose<T>> for &Mass<T> where T: NumLike {
10457 type Output = Energy<T>;
10458 fn mul(self, rhs: AbsorbedDose<T>) -> Self::Output {
10459 Energy{J: self.kg.clone() * rhs.Gy}
10460 }
10461}
10462impl<T> core::ops::Mul<&AbsorbedDose<T>> for Mass<T> where T: NumLike {
10464 type Output = Energy<T>;
10465 fn mul(self, rhs: &AbsorbedDose<T>) -> Self::Output {
10466 Energy{J: self.kg * rhs.Gy.clone()}
10467 }
10468}
10469impl<T> core::ops::Mul<&AbsorbedDose<T>> for &Mass<T> where T: NumLike {
10471 type Output = Energy<T>;
10472 fn mul(self, rhs: &AbsorbedDose<T>) -> Self::Output {
10473 Energy{J: self.kg.clone() * rhs.Gy.clone()}
10474 }
10475}
10476
10477impl<T> core::ops::Mul<DoseEquivalent<T>> for Mass<T> where T: NumLike {
10480 type Output = Energy<T>;
10481 fn mul(self, rhs: DoseEquivalent<T>) -> Self::Output {
10482 Energy{J: self.kg * rhs.Sv}
10483 }
10484}
10485impl<T> core::ops::Mul<DoseEquivalent<T>> for &Mass<T> where T: NumLike {
10487 type Output = Energy<T>;
10488 fn mul(self, rhs: DoseEquivalent<T>) -> Self::Output {
10489 Energy{J: self.kg.clone() * rhs.Sv}
10490 }
10491}
10492impl<T> core::ops::Mul<&DoseEquivalent<T>> for Mass<T> where T: NumLike {
10494 type Output = Energy<T>;
10495 fn mul(self, rhs: &DoseEquivalent<T>) -> Self::Output {
10496 Energy{J: self.kg * rhs.Sv.clone()}
10497 }
10498}
10499impl<T> core::ops::Mul<&DoseEquivalent<T>> for &Mass<T> where T: NumLike {
10501 type Output = Energy<T>;
10502 fn mul(self, rhs: &DoseEquivalent<T>) -> Self::Output {
10503 Energy{J: self.kg.clone() * rhs.Sv.clone()}
10504 }
10505}
10506
10507impl<T> core::ops::Div<InverseAbsorbedDose<T>> for Mass<T> where T: NumLike {
10510 type Output = Energy<T>;
10511 fn div(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
10512 Energy{J: self.kg / rhs.per_Gy}
10513 }
10514}
10515impl<T> core::ops::Div<InverseAbsorbedDose<T>> for &Mass<T> where T: NumLike {
10517 type Output = Energy<T>;
10518 fn div(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
10519 Energy{J: self.kg.clone() / rhs.per_Gy}
10520 }
10521}
10522impl<T> core::ops::Div<&InverseAbsorbedDose<T>> for Mass<T> where T: NumLike {
10524 type Output = Energy<T>;
10525 fn div(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
10526 Energy{J: self.kg / rhs.per_Gy.clone()}
10527 }
10528}
10529impl<T> core::ops::Div<&InverseAbsorbedDose<T>> for &Mass<T> where T: NumLike {
10531 type Output = Energy<T>;
10532 fn div(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
10533 Energy{J: self.kg.clone() / rhs.per_Gy.clone()}
10534 }
10535}
10536
10537impl<T> core::ops::Div<InverseDoseEquivalent<T>> for Mass<T> where T: NumLike {
10540 type Output = Energy<T>;
10541 fn div(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
10542 Energy{J: self.kg / rhs.per_Sv}
10543 }
10544}
10545impl<T> core::ops::Div<InverseDoseEquivalent<T>> for &Mass<T> where T: NumLike {
10547 type Output = Energy<T>;
10548 fn div(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
10549 Energy{J: self.kg.clone() / rhs.per_Sv}
10550 }
10551}
10552impl<T> core::ops::Div<&InverseDoseEquivalent<T>> for Mass<T> where T: NumLike {
10554 type Output = Energy<T>;
10555 fn div(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
10556 Energy{J: self.kg / rhs.per_Sv.clone()}
10557 }
10558}
10559impl<T> core::ops::Div<&InverseDoseEquivalent<T>> for &Mass<T> where T: NumLike {
10561 type Output = Energy<T>;
10562 fn div(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
10563 Energy{J: self.kg.clone() / rhs.per_Sv.clone()}
10564 }
10565}
10566
10567impl<T> core::ops::Div<Mass<T>> for f64 where T: NumLike+From<f64> {
10570 type Output = InverseMass<T>;
10571 fn div(self, rhs: Mass<T>) -> Self::Output {
10572 InverseMass{per_kg: T::from(self) / rhs.kg}
10573 }
10574}
10575impl<T> core::ops::Div<Mass<T>> for &f64 where T: NumLike+From<f64> {
10577 type Output = InverseMass<T>;
10578 fn div(self, rhs: Mass<T>) -> Self::Output {
10579 InverseMass{per_kg: T::from(self.clone()) / rhs.kg}
10580 }
10581}
10582impl<T> core::ops::Div<&Mass<T>> for f64 where T: NumLike+From<f64> {
10584 type Output = InverseMass<T>;
10585 fn div(self, rhs: &Mass<T>) -> Self::Output {
10586 InverseMass{per_kg: T::from(self) / rhs.kg.clone()}
10587 }
10588}
10589impl<T> core::ops::Div<&Mass<T>> for &f64 where T: NumLike+From<f64> {
10591 type Output = InverseMass<T>;
10592 fn div(self, rhs: &Mass<T>) -> Self::Output {
10593 InverseMass{per_kg: T::from(self.clone()) / rhs.kg.clone()}
10594 }
10595}
10596
10597impl<T> core::ops::Div<Mass<T>> for f32 where T: NumLike+From<f32> {
10600 type Output = InverseMass<T>;
10601 fn div(self, rhs: Mass<T>) -> Self::Output {
10602 InverseMass{per_kg: T::from(self) / rhs.kg}
10603 }
10604}
10605impl<T> core::ops::Div<Mass<T>> for &f32 where T: NumLike+From<f32> {
10607 type Output = InverseMass<T>;
10608 fn div(self, rhs: Mass<T>) -> Self::Output {
10609 InverseMass{per_kg: T::from(self.clone()) / rhs.kg}
10610 }
10611}
10612impl<T> core::ops::Div<&Mass<T>> for f32 where T: NumLike+From<f32> {
10614 type Output = InverseMass<T>;
10615 fn div(self, rhs: &Mass<T>) -> Self::Output {
10616 InverseMass{per_kg: T::from(self) / rhs.kg.clone()}
10617 }
10618}
10619impl<T> core::ops::Div<&Mass<T>> for &f32 where T: NumLike+From<f32> {
10621 type Output = InverseMass<T>;
10622 fn div(self, rhs: &Mass<T>) -> Self::Output {
10623 InverseMass{per_kg: T::from(self.clone()) / rhs.kg.clone()}
10624 }
10625}
10626
10627impl<T> core::ops::Div<Mass<T>> for i64 where T: NumLike+From<i64> {
10630 type Output = InverseMass<T>;
10631 fn div(self, rhs: Mass<T>) -> Self::Output {
10632 InverseMass{per_kg: T::from(self) / rhs.kg}
10633 }
10634}
10635impl<T> core::ops::Div<Mass<T>> for &i64 where T: NumLike+From<i64> {
10637 type Output = InverseMass<T>;
10638 fn div(self, rhs: Mass<T>) -> Self::Output {
10639 InverseMass{per_kg: T::from(self.clone()) / rhs.kg}
10640 }
10641}
10642impl<T> core::ops::Div<&Mass<T>> for i64 where T: NumLike+From<i64> {
10644 type Output = InverseMass<T>;
10645 fn div(self, rhs: &Mass<T>) -> Self::Output {
10646 InverseMass{per_kg: T::from(self) / rhs.kg.clone()}
10647 }
10648}
10649impl<T> core::ops::Div<&Mass<T>> for &i64 where T: NumLike+From<i64> {
10651 type Output = InverseMass<T>;
10652 fn div(self, rhs: &Mass<T>) -> Self::Output {
10653 InverseMass{per_kg: T::from(self.clone()) / rhs.kg.clone()}
10654 }
10655}
10656
10657impl<T> core::ops::Div<Mass<T>> for i32 where T: NumLike+From<i32> {
10660 type Output = InverseMass<T>;
10661 fn div(self, rhs: Mass<T>) -> Self::Output {
10662 InverseMass{per_kg: T::from(self) / rhs.kg}
10663 }
10664}
10665impl<T> core::ops::Div<Mass<T>> for &i32 where T: NumLike+From<i32> {
10667 type Output = InverseMass<T>;
10668 fn div(self, rhs: Mass<T>) -> Self::Output {
10669 InverseMass{per_kg: T::from(self.clone()) / rhs.kg}
10670 }
10671}
10672impl<T> core::ops::Div<&Mass<T>> for i32 where T: NumLike+From<i32> {
10674 type Output = InverseMass<T>;
10675 fn div(self, rhs: &Mass<T>) -> Self::Output {
10676 InverseMass{per_kg: T::from(self) / rhs.kg.clone()}
10677 }
10678}
10679impl<T> core::ops::Div<&Mass<T>> for &i32 where T: NumLike+From<i32> {
10681 type Output = InverseMass<T>;
10682 fn div(self, rhs: &Mass<T>) -> Self::Output {
10683 InverseMass{per_kg: T::from(self.clone()) / rhs.kg.clone()}
10684 }
10685}
10686
10687#[cfg(feature="num-bigfloat")]
10690impl<T> core::ops::Div<Mass<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
10691 type Output = InverseMass<T>;
10692 fn div(self, rhs: Mass<T>) -> Self::Output {
10693 InverseMass{per_kg: T::from(self) / rhs.kg}
10694 }
10695}
10696#[cfg(feature="num-bigfloat")]
10698impl<T> core::ops::Div<Mass<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
10699 type Output = InverseMass<T>;
10700 fn div(self, rhs: Mass<T>) -> Self::Output {
10701 InverseMass{per_kg: T::from(self.clone()) / rhs.kg}
10702 }
10703}
10704#[cfg(feature="num-bigfloat")]
10706impl<T> core::ops::Div<&Mass<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
10707 type Output = InverseMass<T>;
10708 fn div(self, rhs: &Mass<T>) -> Self::Output {
10709 InverseMass{per_kg: T::from(self) / rhs.kg.clone()}
10710 }
10711}
10712#[cfg(feature="num-bigfloat")]
10714impl<T> core::ops::Div<&Mass<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
10715 type Output = InverseMass<T>;
10716 fn div(self, rhs: &Mass<T>) -> Self::Output {
10717 InverseMass{per_kg: T::from(self.clone()) / rhs.kg.clone()}
10718 }
10719}
10720
10721#[cfg(feature="num-complex")]
10724impl<T> core::ops::Div<Mass<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
10725 type Output = InverseMass<T>;
10726 fn div(self, rhs: Mass<T>) -> Self::Output {
10727 InverseMass{per_kg: T::from(self) / rhs.kg}
10728 }
10729}
10730#[cfg(feature="num-complex")]
10732impl<T> core::ops::Div<Mass<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
10733 type Output = InverseMass<T>;
10734 fn div(self, rhs: Mass<T>) -> Self::Output {
10735 InverseMass{per_kg: T::from(self.clone()) / rhs.kg}
10736 }
10737}
10738#[cfg(feature="num-complex")]
10740impl<T> core::ops::Div<&Mass<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
10741 type Output = InverseMass<T>;
10742 fn div(self, rhs: &Mass<T>) -> Self::Output {
10743 InverseMass{per_kg: T::from(self) / rhs.kg.clone()}
10744 }
10745}
10746#[cfg(feature="num-complex")]
10748impl<T> core::ops::Div<&Mass<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
10749 type Output = InverseMass<T>;
10750 fn div(self, rhs: &Mass<T>) -> Self::Output {
10751 InverseMass{per_kg: T::from(self.clone()) / rhs.kg.clone()}
10752 }
10753}
10754
10755#[cfg(feature="num-complex")]
10758impl<T> core::ops::Div<Mass<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
10759 type Output = InverseMass<T>;
10760 fn div(self, rhs: Mass<T>) -> Self::Output {
10761 InverseMass{per_kg: T::from(self) / rhs.kg}
10762 }
10763}
10764#[cfg(feature="num-complex")]
10766impl<T> core::ops::Div<Mass<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
10767 type Output = InverseMass<T>;
10768 fn div(self, rhs: Mass<T>) -> Self::Output {
10769 InverseMass{per_kg: T::from(self.clone()) / rhs.kg}
10770 }
10771}
10772#[cfg(feature="num-complex")]
10774impl<T> core::ops::Div<&Mass<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
10775 type Output = InverseMass<T>;
10776 fn div(self, rhs: &Mass<T>) -> Self::Output {
10777 InverseMass{per_kg: T::from(self) / rhs.kg.clone()}
10778 }
10779}
10780#[cfg(feature="num-complex")]
10782impl<T> core::ops::Div<&Mass<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
10783 type Output = InverseMass<T>;
10784 fn div(self, rhs: &Mass<T>) -> Self::Output {
10785 InverseMass{per_kg: T::from(self.clone()) / rhs.kg.clone()}
10786 }
10787}
10788
10789#[derive(UnitStruct, Debug, Clone)]
10791#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
10792pub struct Temperature<T: NumLike>{
10793 pub K: T
10795}
10796
10797impl<T> Temperature<T> where T: NumLike {
10798
10799 pub fn unit_name() -> &'static str { "degrees kelvin" }
10801
10802 pub fn unit_symbol() -> &'static str { "K" }
10804
10805 pub fn from_K(K: T) -> Self { Temperature{K: K} }
10810
10811 pub fn to_K(&self) -> T { self.K.clone() }
10813
10814}
10815
10816impl<T> fmt::Display for Temperature<T> where T: NumLike {
10817 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
10818 write!(f, "{} {}", &self.K, Self::unit_symbol())
10819 }
10820}
10821
10822impl<T> Temperature<T> where T: NumLike+From<f64> {
10823
10824 pub fn to_C(&self) -> T {
10828 return (self.K.clone() * T::from(1.0_f64)) - T::from(273.15_f64);
10829 }
10830
10831 pub fn from_C(C: T) -> Self {
10838 Temperature{K: (C + T::from(273.15_f64)) * T::from(1.0_f64)}
10839 }
10840
10841 pub fn to_celsius(&self) -> T {
10845 return (self.K.clone() * T::from(1.0_f64)) - T::from(273.15_f64);
10846 }
10847
10848 pub fn from_celsius(celsius: T) -> Self {
10855 Temperature{K: (celsius + T::from(273.15_f64)) * T::from(1.0_f64)}
10856 }
10857
10858 pub fn to_F(&self) -> T {
10862 return (self.K.clone() * T::from(1.8_f64)) - T::from(459.67_f64);
10863 }
10864
10865 pub fn from_F(F: T) -> Self {
10872 Temperature{K: (F + T::from(459.67_f64)) * T::from(0.555555555555556_f64)}
10873 }
10874
10875}
10876
10877
10878#[cfg(feature="num-bigfloat")]
10880impl core::ops::Mul<Temperature<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
10881 type Output = Temperature<num_bigfloat::BigFloat>;
10882 fn mul(self, rhs: Temperature<num_bigfloat::BigFloat>) -> Self::Output {
10883 Temperature{K: self * rhs.K}
10884 }
10885}
10886#[cfg(feature="num-bigfloat")]
10888impl core::ops::Mul<Temperature<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
10889 type Output = Temperature<num_bigfloat::BigFloat>;
10890 fn mul(self, rhs: Temperature<num_bigfloat::BigFloat>) -> Self::Output {
10891 Temperature{K: self.clone() * rhs.K}
10892 }
10893}
10894#[cfg(feature="num-bigfloat")]
10896impl core::ops::Mul<&Temperature<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
10897 type Output = Temperature<num_bigfloat::BigFloat>;
10898 fn mul(self, rhs: &Temperature<num_bigfloat::BigFloat>) -> Self::Output {
10899 Temperature{K: self * rhs.K.clone()}
10900 }
10901}
10902#[cfg(feature="num-bigfloat")]
10904impl core::ops::Mul<&Temperature<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
10905 type Output = Temperature<num_bigfloat::BigFloat>;
10906 fn mul(self, rhs: &Temperature<num_bigfloat::BigFloat>) -> Self::Output {
10907 Temperature{K: self.clone() * rhs.K.clone()}
10908 }
10909}
10910
10911#[cfg(feature="num-complex")]
10913impl core::ops::Mul<Temperature<num_complex::Complex32>> for num_complex::Complex32 {
10914 type Output = Temperature<num_complex::Complex32>;
10915 fn mul(self, rhs: Temperature<num_complex::Complex32>) -> Self::Output {
10916 Temperature{K: self * rhs.K}
10917 }
10918}
10919#[cfg(feature="num-complex")]
10921impl core::ops::Mul<Temperature<num_complex::Complex32>> for &num_complex::Complex32 {
10922 type Output = Temperature<num_complex::Complex32>;
10923 fn mul(self, rhs: Temperature<num_complex::Complex32>) -> Self::Output {
10924 Temperature{K: self.clone() * rhs.K}
10925 }
10926}
10927#[cfg(feature="num-complex")]
10929impl core::ops::Mul<&Temperature<num_complex::Complex32>> for num_complex::Complex32 {
10930 type Output = Temperature<num_complex::Complex32>;
10931 fn mul(self, rhs: &Temperature<num_complex::Complex32>) -> Self::Output {
10932 Temperature{K: self * rhs.K.clone()}
10933 }
10934}
10935#[cfg(feature="num-complex")]
10937impl core::ops::Mul<&Temperature<num_complex::Complex32>> for &num_complex::Complex32 {
10938 type Output = Temperature<num_complex::Complex32>;
10939 fn mul(self, rhs: &Temperature<num_complex::Complex32>) -> Self::Output {
10940 Temperature{K: self.clone() * rhs.K.clone()}
10941 }
10942}
10943
10944#[cfg(feature="num-complex")]
10946impl core::ops::Mul<Temperature<num_complex::Complex64>> for num_complex::Complex64 {
10947 type Output = Temperature<num_complex::Complex64>;
10948 fn mul(self, rhs: Temperature<num_complex::Complex64>) -> Self::Output {
10949 Temperature{K: self * rhs.K}
10950 }
10951}
10952#[cfg(feature="num-complex")]
10954impl core::ops::Mul<Temperature<num_complex::Complex64>> for &num_complex::Complex64 {
10955 type Output = Temperature<num_complex::Complex64>;
10956 fn mul(self, rhs: Temperature<num_complex::Complex64>) -> Self::Output {
10957 Temperature{K: self.clone() * rhs.K}
10958 }
10959}
10960#[cfg(feature="num-complex")]
10962impl core::ops::Mul<&Temperature<num_complex::Complex64>> for num_complex::Complex64 {
10963 type Output = Temperature<num_complex::Complex64>;
10964 fn mul(self, rhs: &Temperature<num_complex::Complex64>) -> Self::Output {
10965 Temperature{K: self * rhs.K.clone()}
10966 }
10967}
10968#[cfg(feature="num-complex")]
10970impl core::ops::Mul<&Temperature<num_complex::Complex64>> for &num_complex::Complex64 {
10971 type Output = Temperature<num_complex::Complex64>;
10972 fn mul(self, rhs: &Temperature<num_complex::Complex64>) -> Self::Output {
10973 Temperature{K: self.clone() * rhs.K.clone()}
10974 }
10975}
10976
10977
10978
10979#[cfg(feature = "uom")]
10981impl<T> Into<uom::si::f32::ThermodynamicTemperature> for Temperature<T> where T: NumLike+Into<f32> {
10982 fn into(self) -> uom::si::f32::ThermodynamicTemperature {
10983 uom::si::f32::ThermodynamicTemperature::new::<uom::si::thermodynamic_temperature::kelvin>(self.K.into())
10984 }
10985}
10986
10987#[cfg(feature = "uom")]
10989impl<T> From<uom::si::f32::ThermodynamicTemperature> for Temperature<T> where T: NumLike+From<f32> {
10990 fn from(src: uom::si::f32::ThermodynamicTemperature) -> Self {
10991 Temperature{K: T::from(src.value)}
10992 }
10993}
10994
10995#[cfg(feature = "uom")]
10997impl<T> Into<uom::si::f64::ThermodynamicTemperature> for Temperature<T> where T: NumLike+Into<f64> {
10998 fn into(self) -> uom::si::f64::ThermodynamicTemperature {
10999 uom::si::f64::ThermodynamicTemperature::new::<uom::si::thermodynamic_temperature::kelvin>(self.K.into())
11000 }
11001}
11002
11003#[cfg(feature = "uom")]
11005impl<T> From<uom::si::f64::ThermodynamicTemperature> for Temperature<T> where T: NumLike+From<f64> {
11006 fn from(src: uom::si::f64::ThermodynamicTemperature) -> Self {
11007 Temperature{K: T::from(src.value)}
11008 }
11009}
11010
11011
11012impl<T> core::ops::Mul<InverseAbsorbedDose<T>> for Temperature<T> where T: NumLike {
11015 type Output = InverseSpecificHeatCapacity<T>;
11016 fn mul(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
11017 InverseSpecificHeatCapacity{kgK_per_J: self.K * rhs.per_Gy}
11018 }
11019}
11020impl<T> core::ops::Mul<InverseAbsorbedDose<T>> for &Temperature<T> where T: NumLike {
11022 type Output = InverseSpecificHeatCapacity<T>;
11023 fn mul(self, rhs: InverseAbsorbedDose<T>) -> Self::Output {
11024 InverseSpecificHeatCapacity{kgK_per_J: self.K.clone() * rhs.per_Gy}
11025 }
11026}
11027impl<T> core::ops::Mul<&InverseAbsorbedDose<T>> for Temperature<T> where T: NumLike {
11029 type Output = InverseSpecificHeatCapacity<T>;
11030 fn mul(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
11031 InverseSpecificHeatCapacity{kgK_per_J: self.K * rhs.per_Gy.clone()}
11032 }
11033}
11034impl<T> core::ops::Mul<&InverseAbsorbedDose<T>> for &Temperature<T> where T: NumLike {
11036 type Output = InverseSpecificHeatCapacity<T>;
11037 fn mul(self, rhs: &InverseAbsorbedDose<T>) -> Self::Output {
11038 InverseSpecificHeatCapacity{kgK_per_J: self.K.clone() * rhs.per_Gy.clone()}
11039 }
11040}
11041
11042impl<T> core::ops::Mul<InverseDoseEquivalent<T>> for Temperature<T> where T: NumLike {
11045 type Output = InverseSpecificHeatCapacity<T>;
11046 fn mul(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
11047 InverseSpecificHeatCapacity{kgK_per_J: self.K * rhs.per_Sv}
11048 }
11049}
11050impl<T> core::ops::Mul<InverseDoseEquivalent<T>> for &Temperature<T> where T: NumLike {
11052 type Output = InverseSpecificHeatCapacity<T>;
11053 fn mul(self, rhs: InverseDoseEquivalent<T>) -> Self::Output {
11054 InverseSpecificHeatCapacity{kgK_per_J: self.K.clone() * rhs.per_Sv}
11055 }
11056}
11057impl<T> core::ops::Mul<&InverseDoseEquivalent<T>> for Temperature<T> where T: NumLike {
11059 type Output = InverseSpecificHeatCapacity<T>;
11060 fn mul(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
11061 InverseSpecificHeatCapacity{kgK_per_J: self.K * rhs.per_Sv.clone()}
11062 }
11063}
11064impl<T> core::ops::Mul<&InverseDoseEquivalent<T>> for &Temperature<T> where T: NumLike {
11066 type Output = InverseSpecificHeatCapacity<T>;
11067 fn mul(self, rhs: &InverseDoseEquivalent<T>) -> Self::Output {
11068 InverseSpecificHeatCapacity{kgK_per_J: self.K.clone() * rhs.per_Sv.clone()}
11069 }
11070}
11071
11072impl<T> core::ops::Div<Temperature<T>> for f64 where T: NumLike+From<f64> {
11075 type Output = InverseTemperature<T>;
11076 fn div(self, rhs: Temperature<T>) -> Self::Output {
11077 InverseTemperature{per_K: T::from(self) / rhs.K}
11078 }
11079}
11080impl<T> core::ops::Div<Temperature<T>> for &f64 where T: NumLike+From<f64> {
11082 type Output = InverseTemperature<T>;
11083 fn div(self, rhs: Temperature<T>) -> Self::Output {
11084 InverseTemperature{per_K: T::from(self.clone()) / rhs.K}
11085 }
11086}
11087impl<T> core::ops::Div<&Temperature<T>> for f64 where T: NumLike+From<f64> {
11089 type Output = InverseTemperature<T>;
11090 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11091 InverseTemperature{per_K: T::from(self) / rhs.K.clone()}
11092 }
11093}
11094impl<T> core::ops::Div<&Temperature<T>> for &f64 where T: NumLike+From<f64> {
11096 type Output = InverseTemperature<T>;
11097 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11098 InverseTemperature{per_K: T::from(self.clone()) / rhs.K.clone()}
11099 }
11100}
11101
11102impl<T> core::ops::Div<Temperature<T>> for f32 where T: NumLike+From<f32> {
11105 type Output = InverseTemperature<T>;
11106 fn div(self, rhs: Temperature<T>) -> Self::Output {
11107 InverseTemperature{per_K: T::from(self) / rhs.K}
11108 }
11109}
11110impl<T> core::ops::Div<Temperature<T>> for &f32 where T: NumLike+From<f32> {
11112 type Output = InverseTemperature<T>;
11113 fn div(self, rhs: Temperature<T>) -> Self::Output {
11114 InverseTemperature{per_K: T::from(self.clone()) / rhs.K}
11115 }
11116}
11117impl<T> core::ops::Div<&Temperature<T>> for f32 where T: NumLike+From<f32> {
11119 type Output = InverseTemperature<T>;
11120 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11121 InverseTemperature{per_K: T::from(self) / rhs.K.clone()}
11122 }
11123}
11124impl<T> core::ops::Div<&Temperature<T>> for &f32 where T: NumLike+From<f32> {
11126 type Output = InverseTemperature<T>;
11127 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11128 InverseTemperature{per_K: T::from(self.clone()) / rhs.K.clone()}
11129 }
11130}
11131
11132impl<T> core::ops::Div<Temperature<T>> for i64 where T: NumLike+From<i64> {
11135 type Output = InverseTemperature<T>;
11136 fn div(self, rhs: Temperature<T>) -> Self::Output {
11137 InverseTemperature{per_K: T::from(self) / rhs.K}
11138 }
11139}
11140impl<T> core::ops::Div<Temperature<T>> for &i64 where T: NumLike+From<i64> {
11142 type Output = InverseTemperature<T>;
11143 fn div(self, rhs: Temperature<T>) -> Self::Output {
11144 InverseTemperature{per_K: T::from(self.clone()) / rhs.K}
11145 }
11146}
11147impl<T> core::ops::Div<&Temperature<T>> for i64 where T: NumLike+From<i64> {
11149 type Output = InverseTemperature<T>;
11150 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11151 InverseTemperature{per_K: T::from(self) / rhs.K.clone()}
11152 }
11153}
11154impl<T> core::ops::Div<&Temperature<T>> for &i64 where T: NumLike+From<i64> {
11156 type Output = InverseTemperature<T>;
11157 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11158 InverseTemperature{per_K: T::from(self.clone()) / rhs.K.clone()}
11159 }
11160}
11161
11162impl<T> core::ops::Div<Temperature<T>> for i32 where T: NumLike+From<i32> {
11165 type Output = InverseTemperature<T>;
11166 fn div(self, rhs: Temperature<T>) -> Self::Output {
11167 InverseTemperature{per_K: T::from(self) / rhs.K}
11168 }
11169}
11170impl<T> core::ops::Div<Temperature<T>> for &i32 where T: NumLike+From<i32> {
11172 type Output = InverseTemperature<T>;
11173 fn div(self, rhs: Temperature<T>) -> Self::Output {
11174 InverseTemperature{per_K: T::from(self.clone()) / rhs.K}
11175 }
11176}
11177impl<T> core::ops::Div<&Temperature<T>> for i32 where T: NumLike+From<i32> {
11179 type Output = InverseTemperature<T>;
11180 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11181 InverseTemperature{per_K: T::from(self) / rhs.K.clone()}
11182 }
11183}
11184impl<T> core::ops::Div<&Temperature<T>> for &i32 where T: NumLike+From<i32> {
11186 type Output = InverseTemperature<T>;
11187 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11188 InverseTemperature{per_K: T::from(self.clone()) / rhs.K.clone()}
11189 }
11190}
11191
11192#[cfg(feature="num-bigfloat")]
11195impl<T> core::ops::Div<Temperature<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
11196 type Output = InverseTemperature<T>;
11197 fn div(self, rhs: Temperature<T>) -> Self::Output {
11198 InverseTemperature{per_K: T::from(self) / rhs.K}
11199 }
11200}
11201#[cfg(feature="num-bigfloat")]
11203impl<T> core::ops::Div<Temperature<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
11204 type Output = InverseTemperature<T>;
11205 fn div(self, rhs: Temperature<T>) -> Self::Output {
11206 InverseTemperature{per_K: T::from(self.clone()) / rhs.K}
11207 }
11208}
11209#[cfg(feature="num-bigfloat")]
11211impl<T> core::ops::Div<&Temperature<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
11212 type Output = InverseTemperature<T>;
11213 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11214 InverseTemperature{per_K: T::from(self) / rhs.K.clone()}
11215 }
11216}
11217#[cfg(feature="num-bigfloat")]
11219impl<T> core::ops::Div<&Temperature<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
11220 type Output = InverseTemperature<T>;
11221 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11222 InverseTemperature{per_K: T::from(self.clone()) / rhs.K.clone()}
11223 }
11224}
11225
11226#[cfg(feature="num-complex")]
11229impl<T> core::ops::Div<Temperature<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
11230 type Output = InverseTemperature<T>;
11231 fn div(self, rhs: Temperature<T>) -> Self::Output {
11232 InverseTemperature{per_K: T::from(self) / rhs.K}
11233 }
11234}
11235#[cfg(feature="num-complex")]
11237impl<T> core::ops::Div<Temperature<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
11238 type Output = InverseTemperature<T>;
11239 fn div(self, rhs: Temperature<T>) -> Self::Output {
11240 InverseTemperature{per_K: T::from(self.clone()) / rhs.K}
11241 }
11242}
11243#[cfg(feature="num-complex")]
11245impl<T> core::ops::Div<&Temperature<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
11246 type Output = InverseTemperature<T>;
11247 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11248 InverseTemperature{per_K: T::from(self) / rhs.K.clone()}
11249 }
11250}
11251#[cfg(feature="num-complex")]
11253impl<T> core::ops::Div<&Temperature<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
11254 type Output = InverseTemperature<T>;
11255 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11256 InverseTemperature{per_K: T::from(self.clone()) / rhs.K.clone()}
11257 }
11258}
11259
11260#[cfg(feature="num-complex")]
11263impl<T> core::ops::Div<Temperature<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
11264 type Output = InverseTemperature<T>;
11265 fn div(self, rhs: Temperature<T>) -> Self::Output {
11266 InverseTemperature{per_K: T::from(self) / rhs.K}
11267 }
11268}
11269#[cfg(feature="num-complex")]
11271impl<T> core::ops::Div<Temperature<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
11272 type Output = InverseTemperature<T>;
11273 fn div(self, rhs: Temperature<T>) -> Self::Output {
11274 InverseTemperature{per_K: T::from(self.clone()) / rhs.K}
11275 }
11276}
11277#[cfg(feature="num-complex")]
11279impl<T> core::ops::Div<&Temperature<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
11280 type Output = InverseTemperature<T>;
11281 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11282 InverseTemperature{per_K: T::from(self) / rhs.K.clone()}
11283 }
11284}
11285#[cfg(feature="num-complex")]
11287impl<T> core::ops::Div<&Temperature<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
11288 type Output = InverseTemperature<T>;
11289 fn div(self, rhs: &Temperature<T>) -> Self::Output {
11290 InverseTemperature{per_K: T::from(self.clone()) / rhs.K.clone()}
11291 }
11292}
11293
11294#[derive(UnitStruct, Debug, Clone)]
11296#[cfg_attr(feature="serde", derive(Serialize, Deserialize))]
11297pub struct Time<T: NumLike>{
11298 pub s: T
11300}
11301
11302impl<T> Time<T> where T: NumLike {
11303
11304 pub fn unit_name() -> &'static str { "seconds" }
11306
11307 pub fn unit_symbol() -> &'static str { "s" }
11309
11310 pub fn from_s(s: T) -> Self { Time{s: s} }
11315
11316 pub fn to_s(&self) -> T { self.s.clone() }
11318
11319 pub fn from_seconds(seconds: T) -> Self { Time{s: seconds} }
11324
11325 pub fn to_seconds(&self) -> T { self.s.clone() }
11327
11328}
11329
11330impl<T> fmt::Display for Time<T> where T: NumLike {
11331 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11332 write!(f, "{} {}", &self.s, Self::unit_symbol())
11333 }
11334}
11335
11336impl<T> Time<T> where T: NumLike+From<f64> {
11337
11338 pub fn to_ms(&self) -> T {
11342 return self.s.clone() * T::from(1000.0_f64);
11343 }
11344
11345 pub fn from_ms(ms: T) -> Self {
11352 Time{s: ms * T::from(0.001_f64)}
11353 }
11354
11355 pub fn to_us(&self) -> T {
11359 return self.s.clone() * T::from(1000000.0_f64);
11360 }
11361
11362 pub fn from_us(us: T) -> Self {
11369 Time{s: us * T::from(1e-06_f64)}
11370 }
11371
11372 pub fn to_ns(&self) -> T {
11376 return self.s.clone() * T::from(1000000000.0_f64);
11377 }
11378
11379 pub fn from_ns(ns: T) -> Self {
11386 Time{s: ns * T::from(1e-09_f64)}
11387 }
11388
11389 pub fn to_ps(&self) -> T {
11393 return self.s.clone() * T::from(1000000000000.0_f64);
11394 }
11395
11396 pub fn from_ps(ps: T) -> Self {
11403 Time{s: ps * T::from(1e-12_f64)}
11404 }
11405
11406 pub fn to_min(&self) -> T {
11410 return self.s.clone() * T::from(0.0166666666666667_f64);
11411 }
11412
11413 pub fn from_min(min: T) -> Self {
11420 Time{s: min * T::from(60.0_f64)}
11421 }
11422
11423 pub fn to_hr(&self) -> T {
11427 return self.s.clone() * T::from(0.0002777777777777_f64);
11428 }
11429
11430 pub fn from_hr(hr: T) -> Self {
11437 Time{s: hr * T::from(3600.0_f64)}
11438 }
11439
11440 pub fn to_days(&self) -> T {
11444 return self.s.clone() * T::from(1.15740740740741e-05_f64);
11445 }
11446
11447 pub fn from_days(days: T) -> Self {
11454 Time{s: days * T::from(86400.0_f64)}
11455 }
11456
11457 pub fn to_weeks(&self) -> T {
11461 return self.s.clone() * T::from(1.65343915343915e-06_f64);
11462 }
11463
11464 pub fn from_weeks(weeks: T) -> Self {
11471 Time{s: weeks * T::from(604800.0_f64)}
11472 }
11473
11474 pub fn to_yr(&self) -> T {
11478 return self.s.clone() * T::from(3.16887654287165e-08_f64);
11479 }
11480
11481 pub fn from_yr(yr: T) -> Self {
11488 Time{s: yr * T::from(31556925.19008_f64)}
11489 }
11490
11491 pub fn to_kyr(&self) -> T {
11495 return self.s.clone() * T::from(3.16887654287165e-11_f64);
11496 }
11497
11498 pub fn from_kyr(kyr: T) -> Self {
11505 Time{s: kyr * T::from(31556925190.08_f64)}
11506 }
11507
11508 pub fn to_Myr(&self) -> T {
11512 return self.s.clone() * T::from(3.16887654287165e-14_f64);
11513 }
11514
11515 pub fn from_Myr(Myr: T) -> Self {
11522 Time{s: Myr * T::from(31556925190080.0_f64)}
11523 }
11524
11525 pub fn to_Gyr(&self) -> T {
11529 return self.s.clone() * T::from(3.16887654287165e-17_f64);
11530 }
11531
11532 pub fn from_Gyr(Gyr: T) -> Self {
11539 Time{s: Gyr * T::from(3.155692519008e+16_f64)}
11540 }
11541
11542}
11543
11544
11545#[cfg(feature="num-bigfloat")]
11547impl core::ops::Mul<Time<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
11548 type Output = Time<num_bigfloat::BigFloat>;
11549 fn mul(self, rhs: Time<num_bigfloat::BigFloat>) -> Self::Output {
11550 Time{s: self * rhs.s}
11551 }
11552}
11553#[cfg(feature="num-bigfloat")]
11555impl core::ops::Mul<Time<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
11556 type Output = Time<num_bigfloat::BigFloat>;
11557 fn mul(self, rhs: Time<num_bigfloat::BigFloat>) -> Self::Output {
11558 Time{s: self.clone() * rhs.s}
11559 }
11560}
11561#[cfg(feature="num-bigfloat")]
11563impl core::ops::Mul<&Time<num_bigfloat::BigFloat>> for num_bigfloat::BigFloat {
11564 type Output = Time<num_bigfloat::BigFloat>;
11565 fn mul(self, rhs: &Time<num_bigfloat::BigFloat>) -> Self::Output {
11566 Time{s: self * rhs.s.clone()}
11567 }
11568}
11569#[cfg(feature="num-bigfloat")]
11571impl core::ops::Mul<&Time<num_bigfloat::BigFloat>> for &num_bigfloat::BigFloat {
11572 type Output = Time<num_bigfloat::BigFloat>;
11573 fn mul(self, rhs: &Time<num_bigfloat::BigFloat>) -> Self::Output {
11574 Time{s: self.clone() * rhs.s.clone()}
11575 }
11576}
11577
11578#[cfg(feature="num-complex")]
11580impl core::ops::Mul<Time<num_complex::Complex32>> for num_complex::Complex32 {
11581 type Output = Time<num_complex::Complex32>;
11582 fn mul(self, rhs: Time<num_complex::Complex32>) -> Self::Output {
11583 Time{s: self * rhs.s}
11584 }
11585}
11586#[cfg(feature="num-complex")]
11588impl core::ops::Mul<Time<num_complex::Complex32>> for &num_complex::Complex32 {
11589 type Output = Time<num_complex::Complex32>;
11590 fn mul(self, rhs: Time<num_complex::Complex32>) -> Self::Output {
11591 Time{s: self.clone() * rhs.s}
11592 }
11593}
11594#[cfg(feature="num-complex")]
11596impl core::ops::Mul<&Time<num_complex::Complex32>> for num_complex::Complex32 {
11597 type Output = Time<num_complex::Complex32>;
11598 fn mul(self, rhs: &Time<num_complex::Complex32>) -> Self::Output {
11599 Time{s: self * rhs.s.clone()}
11600 }
11601}
11602#[cfg(feature="num-complex")]
11604impl core::ops::Mul<&Time<num_complex::Complex32>> for &num_complex::Complex32 {
11605 type Output = Time<num_complex::Complex32>;
11606 fn mul(self, rhs: &Time<num_complex::Complex32>) -> Self::Output {
11607 Time{s: self.clone() * rhs.s.clone()}
11608 }
11609}
11610
11611#[cfg(feature="num-complex")]
11613impl core::ops::Mul<Time<num_complex::Complex64>> for num_complex::Complex64 {
11614 type Output = Time<num_complex::Complex64>;
11615 fn mul(self, rhs: Time<num_complex::Complex64>) -> Self::Output {
11616 Time{s: self * rhs.s}
11617 }
11618}
11619#[cfg(feature="num-complex")]
11621impl core::ops::Mul<Time<num_complex::Complex64>> for &num_complex::Complex64 {
11622 type Output = Time<num_complex::Complex64>;
11623 fn mul(self, rhs: Time<num_complex::Complex64>) -> Self::Output {
11624 Time{s: self.clone() * rhs.s}
11625 }
11626}
11627#[cfg(feature="num-complex")]
11629impl core::ops::Mul<&Time<num_complex::Complex64>> for num_complex::Complex64 {
11630 type Output = Time<num_complex::Complex64>;
11631 fn mul(self, rhs: &Time<num_complex::Complex64>) -> Self::Output {
11632 Time{s: self * rhs.s.clone()}
11633 }
11634}
11635#[cfg(feature="num-complex")]
11637impl core::ops::Mul<&Time<num_complex::Complex64>> for &num_complex::Complex64 {
11638 type Output = Time<num_complex::Complex64>;
11639 fn mul(self, rhs: &Time<num_complex::Complex64>) -> Self::Output {
11640 Time{s: self.clone() * rhs.s.clone()}
11641 }
11642}
11643
11644
11645
11646#[cfg(feature = "uom")]
11648impl<T> Into<uom::si::f32::Time> for Time<T> where T: NumLike+Into<f32> {
11649 fn into(self) -> uom::si::f32::Time {
11650 uom::si::f32::Time::new::<uom::si::time::second>(self.s.into())
11651 }
11652}
11653
11654#[cfg(feature = "uom")]
11656impl<T> From<uom::si::f32::Time> for Time<T> where T: NumLike+From<f32> {
11657 fn from(src: uom::si::f32::Time) -> Self {
11658 Time{s: T::from(src.value)}
11659 }
11660}
11661
11662#[cfg(feature = "uom")]
11664impl<T> Into<uom::si::f64::Time> for Time<T> where T: NumLike+Into<f64> {
11665 fn into(self) -> uom::si::f64::Time {
11666 uom::si::f64::Time::new::<uom::si::time::second>(self.s.into())
11667 }
11668}
11669
11670#[cfg(feature = "uom")]
11672impl<T> From<uom::si::f64::Time> for Time<T> where T: NumLike+From<f64> {
11673 fn from(src: uom::si::f64::Time) -> Self {
11674 Time{s: T::from(src.value)}
11675 }
11676}
11677
11678
11679impl<T> core::ops::Div<Amount<T>> for Time<T> where T: NumLike {
11682 type Output = InverseCatalyticActivity<T>;
11683 fn div(self, rhs: Amount<T>) -> Self::Output {
11684 InverseCatalyticActivity{s_per_mol: self.s / rhs.mol}
11685 }
11686}
11687impl<T> core::ops::Div<Amount<T>> for &Time<T> where T: NumLike {
11689 type Output = InverseCatalyticActivity<T>;
11690 fn div(self, rhs: Amount<T>) -> Self::Output {
11691 InverseCatalyticActivity{s_per_mol: self.s.clone() / rhs.mol}
11692 }
11693}
11694impl<T> core::ops::Div<&Amount<T>> for Time<T> where T: NumLike {
11696 type Output = InverseCatalyticActivity<T>;
11697 fn div(self, rhs: &Amount<T>) -> Self::Output {
11698 InverseCatalyticActivity{s_per_mol: self.s / rhs.mol.clone()}
11699 }
11700}
11701impl<T> core::ops::Div<&Amount<T>> for &Time<T> where T: NumLike {
11703 type Output = InverseCatalyticActivity<T>;
11704 fn div(self, rhs: &Amount<T>) -> Self::Output {
11705 InverseCatalyticActivity{s_per_mol: self.s.clone() / rhs.mol.clone()}
11706 }
11707}
11708
11709impl<T> core::ops::Mul<Current<T>> for Time<T> where T: NumLike {
11712 type Output = Charge<T>;
11713 fn mul(self, rhs: Current<T>) -> Self::Output {
11714 Charge{C: self.s * rhs.A}
11715 }
11716}
11717impl<T> core::ops::Mul<Current<T>> for &Time<T> where T: NumLike {
11719 type Output = Charge<T>;
11720 fn mul(self, rhs: Current<T>) -> Self::Output {
11721 Charge{C: self.s.clone() * rhs.A}
11722 }
11723}
11724impl<T> core::ops::Mul<&Current<T>> for Time<T> where T: NumLike {
11726 type Output = Charge<T>;
11727 fn mul(self, rhs: &Current<T>) -> Self::Output {
11728 Charge{C: self.s * rhs.A.clone()}
11729 }
11730}
11731impl<T> core::ops::Mul<&Current<T>> for &Time<T> where T: NumLike {
11733 type Output = Charge<T>;
11734 fn mul(self, rhs: &Current<T>) -> Self::Output {
11735 Charge{C: self.s.clone() * rhs.A.clone()}
11736 }
11737}
11738
11739impl<T> core::ops::Div<Distance<T>> for Time<T> where T: NumLike {
11742 type Output = TimePerDistance<T>;
11743 fn div(self, rhs: Distance<T>) -> Self::Output {
11744 TimePerDistance{spm: self.s / rhs.m}
11745 }
11746}
11747impl<T> core::ops::Div<Distance<T>> for &Time<T> where T: NumLike {
11749 type Output = TimePerDistance<T>;
11750 fn div(self, rhs: Distance<T>) -> Self::Output {
11751 TimePerDistance{spm: self.s.clone() / rhs.m}
11752 }
11753}
11754impl<T> core::ops::Div<&Distance<T>> for Time<T> where T: NumLike {
11756 type Output = TimePerDistance<T>;
11757 fn div(self, rhs: &Distance<T>) -> Self::Output {
11758 TimePerDistance{spm: self.s / rhs.m.clone()}
11759 }
11760}
11761impl<T> core::ops::Div<&Distance<T>> for &Time<T> where T: NumLike {
11763 type Output = TimePerDistance<T>;
11764 fn div(self, rhs: &Distance<T>) -> Self::Output {
11765 TimePerDistance{spm: self.s.clone() / rhs.m.clone()}
11766 }
11767}
11768
11769impl<T> core::ops::Mul<InverseAmount<T>> for Time<T> where T: NumLike {
11772 type Output = InverseCatalyticActivity<T>;
11773 fn mul(self, rhs: InverseAmount<T>) -> Self::Output {
11774 InverseCatalyticActivity{s_per_mol: self.s * rhs.per_mol}
11775 }
11776}
11777impl<T> core::ops::Mul<InverseAmount<T>> for &Time<T> where T: NumLike {
11779 type Output = InverseCatalyticActivity<T>;
11780 fn mul(self, rhs: InverseAmount<T>) -> Self::Output {
11781 InverseCatalyticActivity{s_per_mol: self.s.clone() * rhs.per_mol}
11782 }
11783}
11784impl<T> core::ops::Mul<&InverseAmount<T>> for Time<T> where T: NumLike {
11786 type Output = InverseCatalyticActivity<T>;
11787 fn mul(self, rhs: &InverseAmount<T>) -> Self::Output {
11788 InverseCatalyticActivity{s_per_mol: self.s * rhs.per_mol.clone()}
11789 }
11790}
11791impl<T> core::ops::Mul<&InverseAmount<T>> for &Time<T> where T: NumLike {
11793 type Output = InverseCatalyticActivity<T>;
11794 fn mul(self, rhs: &InverseAmount<T>) -> Self::Output {
11795 InverseCatalyticActivity{s_per_mol: self.s.clone() * rhs.per_mol.clone()}
11796 }
11797}
11798
11799impl<T> core::ops::Div<InverseCurrent<T>> for Time<T> where T: NumLike {
11802 type Output = Charge<T>;
11803 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
11804 Charge{C: self.s / rhs.per_A}
11805 }
11806}
11807impl<T> core::ops::Div<InverseCurrent<T>> for &Time<T> where T: NumLike {
11809 type Output = Charge<T>;
11810 fn div(self, rhs: InverseCurrent<T>) -> Self::Output {
11811 Charge{C: self.s.clone() / rhs.per_A}
11812 }
11813}
11814impl<T> core::ops::Div<&InverseCurrent<T>> for Time<T> where T: NumLike {
11816 type Output = Charge<T>;
11817 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
11818 Charge{C: self.s / rhs.per_A.clone()}
11819 }
11820}
11821impl<T> core::ops::Div<&InverseCurrent<T>> for &Time<T> where T: NumLike {
11823 type Output = Charge<T>;
11824 fn div(self, rhs: &InverseCurrent<T>) -> Self::Output {
11825 Charge{C: self.s.clone() / rhs.per_A.clone()}
11826 }
11827}
11828
11829impl<T> core::ops::Mul<InverseDistance<T>> for Time<T> where T: NumLike {
11832 type Output = TimePerDistance<T>;
11833 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
11834 TimePerDistance{spm: self.s * rhs.per_m}
11835 }
11836}
11837impl<T> core::ops::Mul<InverseDistance<T>> for &Time<T> where T: NumLike {
11839 type Output = TimePerDistance<T>;
11840 fn mul(self, rhs: InverseDistance<T>) -> Self::Output {
11841 TimePerDistance{spm: self.s.clone() * rhs.per_m}
11842 }
11843}
11844impl<T> core::ops::Mul<&InverseDistance<T>> for Time<T> where T: NumLike {
11846 type Output = TimePerDistance<T>;
11847 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
11848 TimePerDistance{spm: self.s * rhs.per_m.clone()}
11849 }
11850}
11851impl<T> core::ops::Mul<&InverseDistance<T>> for &Time<T> where T: NumLike {
11853 type Output = TimePerDistance<T>;
11854 fn mul(self, rhs: &InverseDistance<T>) -> Self::Output {
11855 TimePerDistance{spm: self.s.clone() * rhs.per_m.clone()}
11856 }
11857}
11858
11859impl<T> core::ops::Mul<CatalyticActivity<T>> for Time<T> where T: NumLike {
11862 type Output = Amount<T>;
11863 fn mul(self, rhs: CatalyticActivity<T>) -> Self::Output {
11864 Amount{mol: self.s * rhs.molps}
11865 }
11866}
11867impl<T> core::ops::Mul<CatalyticActivity<T>> for &Time<T> where T: NumLike {
11869 type Output = Amount<T>;
11870 fn mul(self, rhs: CatalyticActivity<T>) -> Self::Output {
11871 Amount{mol: self.s.clone() * rhs.molps}
11872 }
11873}
11874impl<T> core::ops::Mul<&CatalyticActivity<T>> for Time<T> where T: NumLike {
11876 type Output = Amount<T>;
11877 fn mul(self, rhs: &CatalyticActivity<T>) -> Self::Output {
11878 Amount{mol: self.s * rhs.molps.clone()}
11879 }
11880}
11881impl<T> core::ops::Mul<&CatalyticActivity<T>> for &Time<T> where T: NumLike {
11883 type Output = Amount<T>;
11884 fn mul(self, rhs: &CatalyticActivity<T>) -> Self::Output {
11885 Amount{mol: self.s.clone() * rhs.molps.clone()}
11886 }
11887}
11888
11889impl<T> core::ops::Div<InverseCatalyticActivity<T>> for Time<T> where T: NumLike {
11892 type Output = Amount<T>;
11893 fn div(self, rhs: InverseCatalyticActivity<T>) -> Self::Output {
11894 Amount{mol: self.s / rhs.s_per_mol}
11895 }
11896}
11897impl<T> core::ops::Div<InverseCatalyticActivity<T>> for &Time<T> where T: NumLike {
11899 type Output = Amount<T>;
11900 fn div(self, rhs: InverseCatalyticActivity<T>) -> Self::Output {
11901 Amount{mol: self.s.clone() / rhs.s_per_mol}
11902 }
11903}
11904impl<T> core::ops::Div<&InverseCatalyticActivity<T>> for Time<T> where T: NumLike {
11906 type Output = Amount<T>;
11907 fn div(self, rhs: &InverseCatalyticActivity<T>) -> Self::Output {
11908 Amount{mol: self.s / rhs.s_per_mol.clone()}
11909 }
11910}
11911impl<T> core::ops::Div<&InverseCatalyticActivity<T>> for &Time<T> where T: NumLike {
11913 type Output = Amount<T>;
11914 fn div(self, rhs: &InverseCatalyticActivity<T>) -> Self::Output {
11915 Amount{mol: self.s.clone() / rhs.s_per_mol.clone()}
11916 }
11917}
11918
11919impl<T> core::ops::Div<Capacitance<T>> for Time<T> where T: NumLike {
11922 type Output = Resistance<T>;
11923 fn div(self, rhs: Capacitance<T>) -> Self::Output {
11924 Resistance{Ohm: self.s / rhs.F}
11925 }
11926}
11927impl<T> core::ops::Div<Capacitance<T>> for &Time<T> where T: NumLike {
11929 type Output = Resistance<T>;
11930 fn div(self, rhs: Capacitance<T>) -> Self::Output {
11931 Resistance{Ohm: self.s.clone() / rhs.F}
11932 }
11933}
11934impl<T> core::ops::Div<&Capacitance<T>> for Time<T> where T: NumLike {
11936 type Output = Resistance<T>;
11937 fn div(self, rhs: &Capacitance<T>) -> Self::Output {
11938 Resistance{Ohm: self.s / rhs.F.clone()}
11939 }
11940}
11941impl<T> core::ops::Div<&Capacitance<T>> for &Time<T> where T: NumLike {
11943 type Output = Resistance<T>;
11944 fn div(self, rhs: &Capacitance<T>) -> Self::Output {
11945 Resistance{Ohm: self.s.clone() / rhs.F.clone()}
11946 }
11947}
11948
11949impl<T> core::ops::Div<Charge<T>> for Time<T> where T: NumLike {
11952 type Output = InverseCurrent<T>;
11953 fn div(self, rhs: Charge<T>) -> Self::Output {
11954 InverseCurrent{per_A: self.s / rhs.C}
11955 }
11956}
11957impl<T> core::ops::Div<Charge<T>> for &Time<T> where T: NumLike {
11959 type Output = InverseCurrent<T>;
11960 fn div(self, rhs: Charge<T>) -> Self::Output {
11961 InverseCurrent{per_A: self.s.clone() / rhs.C}
11962 }
11963}
11964impl<T> core::ops::Div<&Charge<T>> for Time<T> where T: NumLike {
11966 type Output = InverseCurrent<T>;
11967 fn div(self, rhs: &Charge<T>) -> Self::Output {
11968 InverseCurrent{per_A: self.s / rhs.C.clone()}
11969 }
11970}
11971impl<T> core::ops::Div<&Charge<T>> for &Time<T> where T: NumLike {
11973 type Output = InverseCurrent<T>;
11974 fn div(self, rhs: &Charge<T>) -> Self::Output {
11975 InverseCurrent{per_A: self.s.clone() / rhs.C.clone()}
11976 }
11977}
11978
11979impl<T> core::ops::Mul<Conductance<T>> for Time<T> where T: NumLike {
11982 type Output = Capacitance<T>;
11983 fn mul(self, rhs: Conductance<T>) -> Self::Output {
11984 Capacitance{F: self.s * rhs.S}
11985 }
11986}
11987impl<T> core::ops::Mul<Conductance<T>> for &Time<T> where T: NumLike {
11989 type Output = Capacitance<T>;
11990 fn mul(self, rhs: Conductance<T>) -> Self::Output {
11991 Capacitance{F: self.s.clone() * rhs.S}
11992 }
11993}
11994impl<T> core::ops::Mul<&Conductance<T>> for Time<T> where T: NumLike {
11996 type Output = Capacitance<T>;
11997 fn mul(self, rhs: &Conductance<T>) -> Self::Output {
11998 Capacitance{F: self.s * rhs.S.clone()}
11999 }
12000}
12001impl<T> core::ops::Mul<&Conductance<T>> for &Time<T> where T: NumLike {
12003 type Output = Capacitance<T>;
12004 fn mul(self, rhs: &Conductance<T>) -> Self::Output {
12005 Capacitance{F: self.s.clone() * rhs.S.clone()}
12006 }
12007}
12008
12009impl<T> core::ops::Div<Conductance<T>> for Time<T> where T: NumLike {
12012 type Output = Inductance<T>;
12013 fn div(self, rhs: Conductance<T>) -> Self::Output {
12014 Inductance{H: self.s / rhs.S}
12015 }
12016}
12017impl<T> core::ops::Div<Conductance<T>> for &Time<T> where T: NumLike {
12019 type Output = Inductance<T>;
12020 fn div(self, rhs: Conductance<T>) -> Self::Output {
12021 Inductance{H: self.s.clone() / rhs.S}
12022 }
12023}
12024impl<T> core::ops::Div<&Conductance<T>> for Time<T> where T: NumLike {
12026 type Output = Inductance<T>;
12027 fn div(self, rhs: &Conductance<T>) -> Self::Output {
12028 Inductance{H: self.s / rhs.S.clone()}
12029 }
12030}
12031impl<T> core::ops::Div<&Conductance<T>> for &Time<T> where T: NumLike {
12033 type Output = Inductance<T>;
12034 fn div(self, rhs: &Conductance<T>) -> Self::Output {
12035 Inductance{H: self.s.clone() / rhs.S.clone()}
12036 }
12037}
12038
12039impl<T> core::ops::Mul<Elastance<T>> for Time<T> where T: NumLike {
12042 type Output = Resistance<T>;
12043 fn mul(self, rhs: Elastance<T>) -> Self::Output {
12044 Resistance{Ohm: self.s * rhs.per_F}
12045 }
12046}
12047impl<T> core::ops::Mul<Elastance<T>> for &Time<T> where T: NumLike {
12049 type Output = Resistance<T>;
12050 fn mul(self, rhs: Elastance<T>) -> Self::Output {
12051 Resistance{Ohm: self.s.clone() * rhs.per_F}
12052 }
12053}
12054impl<T> core::ops::Mul<&Elastance<T>> for Time<T> where T: NumLike {
12056 type Output = Resistance<T>;
12057 fn mul(self, rhs: &Elastance<T>) -> Self::Output {
12058 Resistance{Ohm: self.s * rhs.per_F.clone()}
12059 }
12060}
12061impl<T> core::ops::Mul<&Elastance<T>> for &Time<T> where T: NumLike {
12063 type Output = Resistance<T>;
12064 fn mul(self, rhs: &Elastance<T>) -> Self::Output {
12065 Resistance{Ohm: self.s.clone() * rhs.per_F.clone()}
12066 }
12067}
12068
12069impl<T> core::ops::Div<Inductance<T>> for Time<T> where T: NumLike {
12072 type Output = Conductance<T>;
12073 fn div(self, rhs: Inductance<T>) -> Self::Output {
12074 Conductance{S: self.s / rhs.H}
12075 }
12076}
12077impl<T> core::ops::Div<Inductance<T>> for &Time<T> where T: NumLike {
12079 type Output = Conductance<T>;
12080 fn div(self, rhs: Inductance<T>) -> Self::Output {
12081 Conductance{S: self.s.clone() / rhs.H}
12082 }
12083}
12084impl<T> core::ops::Div<&Inductance<T>> for Time<T> where T: NumLike {
12086 type Output = Conductance<T>;
12087 fn div(self, rhs: &Inductance<T>) -> Self::Output {
12088 Conductance{S: self.s / rhs.H.clone()}
12089 }
12090}
12091impl<T> core::ops::Div<&Inductance<T>> for &Time<T> where T: NumLike {
12093 type Output = Conductance<T>;
12094 fn div(self, rhs: &Inductance<T>) -> Self::Output {
12095 Conductance{S: self.s.clone() / rhs.H.clone()}
12096 }
12097}
12098
12099impl<T> core::ops::Mul<InverseCharge<T>> for Time<T> where T: NumLike {
12102 type Output = InverseCurrent<T>;
12103 fn mul(self, rhs: InverseCharge<T>) -> Self::Output {
12104 InverseCurrent{per_A: self.s * rhs.per_C}
12105 }
12106}
12107impl<T> core::ops::Mul<InverseCharge<T>> for &Time<T> where T: NumLike {
12109 type Output = InverseCurrent<T>;
12110 fn mul(self, rhs: InverseCharge<T>) -> Self::Output {
12111 InverseCurrent{per_A: self.s.clone() * rhs.per_C}
12112 }
12113}
12114impl<T> core::ops::Mul<&InverseCharge<T>> for Time<T> where T: NumLike {
12116 type Output = InverseCurrent<T>;
12117 fn mul(self, rhs: &InverseCharge<T>) -> Self::Output {
12118 InverseCurrent{per_A: self.s * rhs.per_C.clone()}
12119 }
12120}
12121impl<T> core::ops::Mul<&InverseCharge<T>> for &Time<T> where T: NumLike {
12123 type Output = InverseCurrent<T>;
12124 fn mul(self, rhs: &InverseCharge<T>) -> Self::Output {
12125 InverseCurrent{per_A: self.s.clone() * rhs.per_C.clone()}
12126 }
12127}
12128
12129impl<T> core::ops::Mul<InverseInductance<T>> for Time<T> where T: NumLike {
12132 type Output = Conductance<T>;
12133 fn mul(self, rhs: InverseInductance<T>) -> Self::Output {
12134 Conductance{S: self.s * rhs.per_H}
12135 }
12136}
12137impl<T> core::ops::Mul<InverseInductance<T>> for &Time<T> where T: NumLike {
12139 type Output = Conductance<T>;
12140 fn mul(self, rhs: InverseInductance<T>) -> Self::Output {
12141 Conductance{S: self.s.clone() * rhs.per_H}
12142 }
12143}
12144impl<T> core::ops::Mul<&InverseInductance<T>> for Time<T> where T: NumLike {
12146 type Output = Conductance<T>;
12147 fn mul(self, rhs: &InverseInductance<T>) -> Self::Output {
12148 Conductance{S: self.s * rhs.per_H.clone()}
12149 }
12150}
12151impl<T> core::ops::Mul<&InverseInductance<T>> for &Time<T> where T: NumLike {
12153 type Output = Conductance<T>;
12154 fn mul(self, rhs: &InverseInductance<T>) -> Self::Output {
12155 Conductance{S: self.s.clone() * rhs.per_H.clone()}
12156 }
12157}
12158
12159impl<T> core::ops::Mul<InverseMagneticFlux<T>> for Time<T> where T: NumLike {
12162 type Output = InverseVoltage<T>;
12163 fn mul(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
12164 InverseVoltage{per_V: self.s * rhs.per_Wb}
12165 }
12166}
12167impl<T> core::ops::Mul<InverseMagneticFlux<T>> for &Time<T> where T: NumLike {
12169 type Output = InverseVoltage<T>;
12170 fn mul(self, rhs: InverseMagneticFlux<T>) -> Self::Output {
12171 InverseVoltage{per_V: self.s.clone() * rhs.per_Wb}
12172 }
12173}
12174impl<T> core::ops::Mul<&InverseMagneticFlux<T>> for Time<T> where T: NumLike {
12176 type Output = InverseVoltage<T>;
12177 fn mul(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
12178 InverseVoltage{per_V: self.s * rhs.per_Wb.clone()}
12179 }
12180}
12181impl<T> core::ops::Mul<&InverseMagneticFlux<T>> for &Time<T> where T: NumLike {
12183 type Output = InverseVoltage<T>;
12184 fn mul(self, rhs: &InverseMagneticFlux<T>) -> Self::Output {
12185 InverseVoltage{per_V: self.s.clone() * rhs.per_Wb.clone()}
12186 }
12187}
12188
12189impl<T> core::ops::Div<InverseVoltage<T>> for Time<T> where T: NumLike {
12192 type Output = MagneticFlux<T>;
12193 fn div(self, rhs: InverseVoltage<T>) -> Self::Output {
12194 MagneticFlux{Wb: self.s / rhs.per_V}
12195 }
12196}
12197impl<T> core::ops::Div<InverseVoltage<T>> for &Time<T> where T: NumLike {
12199 type Output = MagneticFlux<T>;
12200 fn div(self, rhs: InverseVoltage<T>) -> Self::Output {
12201 MagneticFlux{Wb: self.s.clone() / rhs.per_V}
12202 }
12203}
12204impl<T> core::ops::Div<&InverseVoltage<T>> for Time<T> where T: NumLike {
12206 type Output = MagneticFlux<T>;
12207 fn div(self, rhs: &InverseVoltage<T>) -> Self::Output {
12208 MagneticFlux{Wb: self.s / rhs.per_V.clone()}
12209 }
12210}
12211impl<T> core::ops::Div<&InverseVoltage<T>> for &Time<T> where T: NumLike {
12213 type Output = MagneticFlux<T>;
12214 fn div(self, rhs: &InverseVoltage<T>) -> Self::Output {
12215 MagneticFlux{Wb: self.s.clone() / rhs.per_V.clone()}
12216 }
12217}
12218
12219impl<T> core::ops::Div<MagneticFlux<T>> for Time<T> where T: NumLike {
12222 type Output = InverseVoltage<T>;
12223 fn div(self, rhs: MagneticFlux<T>) -> Self::Output {
12224 InverseVoltage{per_V: self.s / rhs.Wb}
12225 }
12226}
12227impl<T> core::ops::Div<MagneticFlux<T>> for &Time<T> where T: NumLike {
12229 type Output = InverseVoltage<T>;
12230 fn div(self, rhs: MagneticFlux<T>) -> Self::Output {
12231 InverseVoltage{per_V: self.s.clone() / rhs.Wb}
12232 }
12233}
12234impl<T> core::ops::Div<&MagneticFlux<T>> for Time<T> where T: NumLike {
12236 type Output = InverseVoltage<T>;
12237 fn div(self, rhs: &MagneticFlux<T>) -> Self::Output {
12238 InverseVoltage{per_V: self.s / rhs.Wb.clone()}
12239 }
12240}
12241impl<T> core::ops::Div<&MagneticFlux<T>> for &Time<T> where T: NumLike {
12243 type Output = InverseVoltage<T>;
12244 fn div(self, rhs: &MagneticFlux<T>) -> Self::Output {
12245 InverseVoltage{per_V: self.s.clone() / rhs.Wb.clone()}
12246 }
12247}
12248
12249impl<T> core::ops::Mul<Resistance<T>> for Time<T> where T: NumLike {
12252 type Output = Inductance<T>;
12253 fn mul(self, rhs: Resistance<T>) -> Self::Output {
12254 Inductance{H: self.s * rhs.Ohm}
12255 }
12256}
12257impl<T> core::ops::Mul<Resistance<T>> for &Time<T> where T: NumLike {
12259 type Output = Inductance<T>;
12260 fn mul(self, rhs: Resistance<T>) -> Self::Output {
12261 Inductance{H: self.s.clone() * rhs.Ohm}
12262 }
12263}
12264impl<T> core::ops::Mul<&Resistance<T>> for Time<T> where T: NumLike {
12266 type Output = Inductance<T>;
12267 fn mul(self, rhs: &Resistance<T>) -> Self::Output {
12268 Inductance{H: self.s * rhs.Ohm.clone()}
12269 }
12270}
12271impl<T> core::ops::Mul<&Resistance<T>> for &Time<T> where T: NumLike {
12273 type Output = Inductance<T>;
12274 fn mul(self, rhs: &Resistance<T>) -> Self::Output {
12275 Inductance{H: self.s.clone() * rhs.Ohm.clone()}
12276 }
12277}
12278
12279impl<T> core::ops::Div<Resistance<T>> for Time<T> where T: NumLike {
12282 type Output = Capacitance<T>;
12283 fn div(self, rhs: Resistance<T>) -> Self::Output {
12284 Capacitance{F: self.s / rhs.Ohm}
12285 }
12286}
12287impl<T> core::ops::Div<Resistance<T>> for &Time<T> where T: NumLike {
12289 type Output = Capacitance<T>;
12290 fn div(self, rhs: Resistance<T>) -> Self::Output {
12291 Capacitance{F: self.s.clone() / rhs.Ohm}
12292 }
12293}
12294impl<T> core::ops::Div<&Resistance<T>> for Time<T> where T: NumLike {
12296 type Output = Capacitance<T>;
12297 fn div(self, rhs: &Resistance<T>) -> Self::Output {
12298 Capacitance{F: self.s / rhs.Ohm.clone()}
12299 }
12300}
12301impl<T> core::ops::Div<&Resistance<T>> for &Time<T> where T: NumLike {
12303 type Output = Capacitance<T>;
12304 fn div(self, rhs: &Resistance<T>) -> Self::Output {
12305 Capacitance{F: self.s.clone() / rhs.Ohm.clone()}
12306 }
12307}
12308
12309impl<T> core::ops::Mul<Voltage<T>> for Time<T> where T: NumLike {
12312 type Output = MagneticFlux<T>;
12313 fn mul(self, rhs: Voltage<T>) -> Self::Output {
12314 MagneticFlux{Wb: self.s * rhs.V}
12315 }
12316}
12317impl<T> core::ops::Mul<Voltage<T>> for &Time<T> where T: NumLike {
12319 type Output = MagneticFlux<T>;
12320 fn mul(self, rhs: Voltage<T>) -> Self::Output {
12321 MagneticFlux{Wb: self.s.clone() * rhs.V}
12322 }
12323}
12324impl<T> core::ops::Mul<&Voltage<T>> for Time<T> where T: NumLike {
12326 type Output = MagneticFlux<T>;
12327 fn mul(self, rhs: &Voltage<T>) -> Self::Output {
12328 MagneticFlux{Wb: self.s * rhs.V.clone()}
12329 }
12330}
12331impl<T> core::ops::Mul<&Voltage<T>> for &Time<T> where T: NumLike {
12333 type Output = MagneticFlux<T>;
12334 fn mul(self, rhs: &Voltage<T>) -> Self::Output {
12335 MagneticFlux{Wb: self.s.clone() * rhs.V.clone()}
12336 }
12337}
12338
12339impl<T> core::ops::Div<Angle<T>> for Time<T> where T: NumLike {
12342 type Output = InverseAngularVelocity<T>;
12343 fn div(self, rhs: Angle<T>) -> Self::Output {
12344 InverseAngularVelocity{s_per_rad: self.s / rhs.rad}
12345 }
12346}
12347impl<T> core::ops::Div<Angle<T>> for &Time<T> where T: NumLike {
12349 type Output = InverseAngularVelocity<T>;
12350 fn div(self, rhs: Angle<T>) -> Self::Output {
12351 InverseAngularVelocity{s_per_rad: self.s.clone() / rhs.rad}
12352 }
12353}
12354impl<T> core::ops::Div<&Angle<T>> for Time<T> where T: NumLike {
12356 type Output = InverseAngularVelocity<T>;
12357 fn div(self, rhs: &Angle<T>) -> Self::Output {
12358 InverseAngularVelocity{s_per_rad: self.s / rhs.rad.clone()}
12359 }
12360}
12361impl<T> core::ops::Div<&Angle<T>> for &Time<T> where T: NumLike {
12363 type Output = InverseAngularVelocity<T>;
12364 fn div(self, rhs: &Angle<T>) -> Self::Output {
12365 InverseAngularVelocity{s_per_rad: self.s.clone() / rhs.rad.clone()}
12366 }
12367}
12368
12369impl<T> core::ops::Mul<InverseAngle<T>> for Time<T> where T: NumLike {
12372 type Output = InverseAngularVelocity<T>;
12373 fn mul(self, rhs: InverseAngle<T>) -> Self::Output {
12374 InverseAngularVelocity{s_per_rad: self.s * rhs.per_rad}
12375 }
12376}
12377impl<T> core::ops::Mul<InverseAngle<T>> for &Time<T> where T: NumLike {
12379 type Output = InverseAngularVelocity<T>;
12380 fn mul(self, rhs: InverseAngle<T>) -> Self::Output {
12381 InverseAngularVelocity{s_per_rad: self.s.clone() * rhs.per_rad}
12382 }
12383}
12384impl<T> core::ops::Mul<&InverseAngle<T>> for Time<T> where T: NumLike {
12386 type Output = InverseAngularVelocity<T>;
12387 fn mul(self, rhs: &InverseAngle<T>) -> Self::Output {
12388 InverseAngularVelocity{s_per_rad: self.s * rhs.per_rad.clone()}
12389 }
12390}
12391impl<T> core::ops::Mul<&InverseAngle<T>> for &Time<T> where T: NumLike {
12393 type Output = InverseAngularVelocity<T>;
12394 fn mul(self, rhs: &InverseAngle<T>) -> Self::Output {
12395 InverseAngularVelocity{s_per_rad: self.s.clone() * rhs.per_rad.clone()}
12396 }
12397}
12398
12399impl<T> core::ops::Mul<Acceleration<T>> for Time<T> where T: NumLike {
12402 type Output = Velocity<T>;
12403 fn mul(self, rhs: Acceleration<T>) -> Self::Output {
12404 Velocity{mps: self.s * rhs.mps2}
12405 }
12406}
12407impl<T> core::ops::Mul<Acceleration<T>> for &Time<T> where T: NumLike {
12409 type Output = Velocity<T>;
12410 fn mul(self, rhs: Acceleration<T>) -> Self::Output {
12411 Velocity{mps: self.s.clone() * rhs.mps2}
12412 }
12413}
12414impl<T> core::ops::Mul<&Acceleration<T>> for Time<T> where T: NumLike {
12416 type Output = Velocity<T>;
12417 fn mul(self, rhs: &Acceleration<T>) -> Self::Output {
12418 Velocity{mps: self.s * rhs.mps2.clone()}
12419 }
12420}
12421impl<T> core::ops::Mul<&Acceleration<T>> for &Time<T> where T: NumLike {
12423 type Output = Velocity<T>;
12424 fn mul(self, rhs: &Acceleration<T>) -> Self::Output {
12425 Velocity{mps: self.s.clone() * rhs.mps2.clone()}
12426 }
12427}
12428
12429impl<T> core::ops::Mul<AngularAcceleration<T>> for Time<T> where T: NumLike {
12432 type Output = AngularVelocity<T>;
12433 fn mul(self, rhs: AngularAcceleration<T>) -> Self::Output {
12434 AngularVelocity{radps: self.s * rhs.radps2}
12435 }
12436}
12437impl<T> core::ops::Mul<AngularAcceleration<T>> for &Time<T> where T: NumLike {
12439 type Output = AngularVelocity<T>;
12440 fn mul(self, rhs: AngularAcceleration<T>) -> Self::Output {
12441 AngularVelocity{radps: self.s.clone() * rhs.radps2}
12442 }
12443}
12444impl<T> core::ops::Mul<&AngularAcceleration<T>> for Time<T> where T: NumLike {
12446 type Output = AngularVelocity<T>;
12447 fn mul(self, rhs: &AngularAcceleration<T>) -> Self::Output {
12448 AngularVelocity{radps: self.s * rhs.radps2.clone()}
12449 }
12450}
12451impl<T> core::ops::Mul<&AngularAcceleration<T>> for &Time<T> where T: NumLike {
12453 type Output = AngularVelocity<T>;
12454 fn mul(self, rhs: &AngularAcceleration<T>) -> Self::Output {
12455 AngularVelocity{radps: self.s.clone() * rhs.radps2.clone()}
12456 }
12457}
12458
12459impl<T> core::ops::Mul<AngularVelocity<T>> for Time<T> where T: NumLike {
12462 type Output = Angle<T>;
12463 fn mul(self, rhs: AngularVelocity<T>) -> Self::Output {
12464 Angle{rad: self.s * rhs.radps}
12465 }
12466}
12467impl<T> core::ops::Mul<AngularVelocity<T>> for &Time<T> where T: NumLike {
12469 type Output = Angle<T>;
12470 fn mul(self, rhs: AngularVelocity<T>) -> Self::Output {
12471 Angle{rad: self.s.clone() * rhs.radps}
12472 }
12473}
12474impl<T> core::ops::Mul<&AngularVelocity<T>> for Time<T> where T: NumLike {
12476 type Output = Angle<T>;
12477 fn mul(self, rhs: &AngularVelocity<T>) -> Self::Output {
12478 Angle{rad: self.s * rhs.radps.clone()}
12479 }
12480}
12481impl<T> core::ops::Mul<&AngularVelocity<T>> for &Time<T> where T: NumLike {
12483 type Output = Angle<T>;
12484 fn mul(self, rhs: &AngularVelocity<T>) -> Self::Output {
12485 Angle{rad: self.s.clone() * rhs.radps.clone()}
12486 }
12487}
12488
12489impl<T> core::ops::Div<AngularVelocity<T>> for Time<T> where T: NumLike {
12492 type Output = InverseAngularAcceleration<T>;
12493 fn div(self, rhs: AngularVelocity<T>) -> Self::Output {
12494 InverseAngularAcceleration{s2prad: self.s / rhs.radps}
12495 }
12496}
12497impl<T> core::ops::Div<AngularVelocity<T>> for &Time<T> where T: NumLike {
12499 type Output = InverseAngularAcceleration<T>;
12500 fn div(self, rhs: AngularVelocity<T>) -> Self::Output {
12501 InverseAngularAcceleration{s2prad: self.s.clone() / rhs.radps}
12502 }
12503}
12504impl<T> core::ops::Div<&AngularVelocity<T>> for Time<T> where T: NumLike {
12506 type Output = InverseAngularAcceleration<T>;
12507 fn div(self, rhs: &AngularVelocity<T>) -> Self::Output {
12508 InverseAngularAcceleration{s2prad: self.s / rhs.radps.clone()}
12509 }
12510}
12511impl<T> core::ops::Div<&AngularVelocity<T>> for &Time<T> where T: NumLike {
12513 type Output = InverseAngularAcceleration<T>;
12514 fn div(self, rhs: &AngularVelocity<T>) -> Self::Output {
12515 InverseAngularAcceleration{s2prad: self.s.clone() / rhs.radps.clone()}
12516 }
12517}
12518
12519impl<T> core::ops::Div<Energy<T>> for Time<T> where T: NumLike {
12522 type Output = InversePower<T>;
12523 fn div(self, rhs: Energy<T>) -> Self::Output {
12524 InversePower{per_W: self.s / rhs.J}
12525 }
12526}
12527impl<T> core::ops::Div<Energy<T>> for &Time<T> where T: NumLike {
12529 type Output = InversePower<T>;
12530 fn div(self, rhs: Energy<T>) -> Self::Output {
12531 InversePower{per_W: self.s.clone() / rhs.J}
12532 }
12533}
12534impl<T> core::ops::Div<&Energy<T>> for Time<T> where T: NumLike {
12536 type Output = InversePower<T>;
12537 fn div(self, rhs: &Energy<T>) -> Self::Output {
12538 InversePower{per_W: self.s / rhs.J.clone()}
12539 }
12540}
12541impl<T> core::ops::Div<&Energy<T>> for &Time<T> where T: NumLike {
12543 type Output = InversePower<T>;
12544 fn div(self, rhs: &Energy<T>) -> Self::Output {
12545 InversePower{per_W: self.s.clone() / rhs.J.clone()}
12546 }
12547}
12548
12549impl<T> core::ops::Div<Torque<T>> for Time<T> where T: NumLike {
12552 type Output = InversePower<T>;
12553 fn div(self, rhs: Torque<T>) -> Self::Output {
12554 InversePower{per_W: self.s / rhs.Nm}
12555 }
12556}
12557impl<T> core::ops::Div<Torque<T>> for &Time<T> where T: NumLike {
12559 type Output = InversePower<T>;
12560 fn div(self, rhs: Torque<T>) -> Self::Output {
12561 InversePower{per_W: self.s.clone() / rhs.Nm}
12562 }
12563}
12564impl<T> core::ops::Div<&Torque<T>> for Time<T> where T: NumLike {
12566 type Output = InversePower<T>;
12567 fn div(self, rhs: &Torque<T>) -> Self::Output {
12568 InversePower{per_W: self.s / rhs.Nm.clone()}
12569 }
12570}
12571impl<T> core::ops::Div<&Torque<T>> for &Time<T> where T: NumLike {
12573 type Output = InversePower<T>;
12574 fn div(self, rhs: &Torque<T>) -> Self::Output {
12575 InversePower{per_W: self.s.clone() / rhs.Nm.clone()}
12576 }
12577}
12578
12579impl<T> core::ops::Mul<Force<T>> for Time<T> where T: NumLike {
12582 type Output = Momentum<T>;
12583 fn mul(self, rhs: Force<T>) -> Self::Output {
12584 Momentum{kgmps: self.s * rhs.N}
12585 }
12586}
12587impl<T> core::ops::Mul<Force<T>> for &Time<T> where T: NumLike {
12589 type Output = Momentum<T>;
12590 fn mul(self, rhs: Force<T>) -> Self::Output {
12591 Momentum{kgmps: self.s.clone() * rhs.N}
12592 }
12593}
12594impl<T> core::ops::Mul<&Force<T>> for Time<T> where T: NumLike {
12596 type Output = Momentum<T>;
12597 fn mul(self, rhs: &Force<T>) -> Self::Output {
12598 Momentum{kgmps: self.s * rhs.N.clone()}
12599 }
12600}
12601impl<T> core::ops::Mul<&Force<T>> for &Time<T> where T: NumLike {
12603 type Output = Momentum<T>;
12604 fn mul(self, rhs: &Force<T>) -> Self::Output {
12605 Momentum{kgmps: self.s.clone() * rhs.N.clone()}
12606 }
12607}
12608
12609impl<T> core::ops::Div<InverseAcceleration<T>> for Time<T> where T: NumLike {
12612 type Output = Velocity<T>;
12613 fn div(self, rhs: InverseAcceleration<T>) -> Self::Output {
12614 Velocity{mps: self.s / rhs.s2pm}
12615 }
12616}
12617impl<T> core::ops::Div<InverseAcceleration<T>> for &Time<T> where T: NumLike {
12619 type Output = Velocity<T>;
12620 fn div(self, rhs: InverseAcceleration<T>) -> Self::Output {
12621 Velocity{mps: self.s.clone() / rhs.s2pm}
12622 }
12623}
12624impl<T> core::ops::Div<&InverseAcceleration<T>> for Time<T> where T: NumLike {
12626 type Output = Velocity<T>;
12627 fn div(self, rhs: &InverseAcceleration<T>) -> Self::Output {
12628 Velocity{mps: self.s / rhs.s2pm.clone()}
12629 }
12630}
12631impl<T> core::ops::Div<&InverseAcceleration<T>> for &Time<T> where T: NumLike {
12633 type Output = Velocity<T>;
12634 fn div(self, rhs: &InverseAcceleration<T>) -> Self::Output {
12635 Velocity{mps: self.s.clone() / rhs.s2pm.clone()}
12636 }
12637}
12638
12639impl<T> core::ops::Div<InverseAngularAcceleration<T>> for Time<T> where T: NumLike {
12642 type Output = AngularVelocity<T>;
12643 fn div(self, rhs: InverseAngularAcceleration<T>) -> Self::Output {
12644 AngularVelocity{radps: self.s / rhs.s2prad}
12645 }
12646}
12647impl<T> core::ops::Div<InverseAngularAcceleration<T>> for &Time<T> where T: NumLike {
12649 type Output = AngularVelocity<T>;
12650 fn div(self, rhs: InverseAngularAcceleration<T>) -> Self::Output {
12651 AngularVelocity{radps: self.s.clone() / rhs.s2prad}
12652 }
12653}
12654impl<T> core::ops::Div<&InverseAngularAcceleration<T>> for Time<T> where T: NumLike {
12656 type Output = AngularVelocity<T>;
12657 fn div(self, rhs: &InverseAngularAcceleration<T>) -> Self::Output {
12658 AngularVelocity{radps: self.s / rhs.s2prad.clone()}
12659 }
12660}
12661impl<T> core::ops::Div<&InverseAngularAcceleration<T>> for &Time<T> where T: NumLike {
12663 type Output = AngularVelocity<T>;
12664 fn div(self, rhs: &InverseAngularAcceleration<T>) -> Self::Output {
12665 AngularVelocity{radps: self.s.clone() / rhs.s2prad.clone()}
12666 }
12667}
12668
12669impl<T> core::ops::Mul<InverseAngularVelocity<T>> for Time<T> where T: NumLike {
12672 type Output = InverseAngularAcceleration<T>;
12673 fn mul(self, rhs: InverseAngularVelocity<T>) -> Self::Output {
12674 InverseAngularAcceleration{s2prad: self.s * rhs.s_per_rad}
12675 }
12676}
12677impl<T> core::ops::Mul<InverseAngularVelocity<T>> for &Time<T> where T: NumLike {
12679 type Output = InverseAngularAcceleration<T>;
12680 fn mul(self, rhs: InverseAngularVelocity<T>) -> Self::Output {
12681 InverseAngularAcceleration{s2prad: self.s.clone() * rhs.s_per_rad}
12682 }
12683}
12684impl<T> core::ops::Mul<&InverseAngularVelocity<T>> for Time<T> where T: NumLike {
12686 type Output = InverseAngularAcceleration<T>;
12687 fn mul(self, rhs: &InverseAngularVelocity<T>) -> Self::Output {
12688 InverseAngularAcceleration{s2prad: self.s * rhs.s_per_rad.clone()}
12689 }
12690}
12691impl<T> core::ops::Mul<&InverseAngularVelocity<T>> for &Time<T> where T: NumLike {
12693 type Output = InverseAngularAcceleration<T>;
12694 fn mul(self, rhs: &InverseAngularVelocity<T>) -> Self::Output {
12695 InverseAngularAcceleration{s2prad: self.s.clone() * rhs.s_per_rad.clone()}
12696 }
12697}
12698
12699impl<T> core::ops::Div<InverseAngularVelocity<T>> for Time<T> where T: NumLike {
12702 type Output = Angle<T>;
12703 fn div(self, rhs: InverseAngularVelocity<T>) -> Self::Output {
12704 Angle{rad: self.s / rhs.s_per_rad}
12705 }
12706}
12707impl<T> core::ops::Div<InverseAngularVelocity<T>> for &Time<T> where T: NumLike {
12709 type Output = Angle<T>;
12710 fn div(self, rhs: InverseAngularVelocity<T>) -> Self::Output {
12711 Angle{rad: self.s.clone() / rhs.s_per_rad}
12712 }
12713}
12714impl<T> core::ops::Div<&InverseAngularVelocity<T>> for Time<T> where T: NumLike {
12716 type Output = Angle<T>;
12717 fn div(self, rhs: &InverseAngularVelocity<T>) -> Self::Output {
12718 Angle{rad: self.s / rhs.s_per_rad.clone()}
12719 }
12720}
12721impl<T> core::ops::Div<&InverseAngularVelocity<T>> for &Time<T> where T: NumLike {
12723 type Output = Angle<T>;
12724 fn div(self, rhs: &InverseAngularVelocity<T>) -> Self::Output {
12725 Angle{rad: self.s.clone() / rhs.s_per_rad.clone()}
12726 }
12727}
12728
12729impl<T> core::ops::Mul<InverseEnergy<T>> for Time<T> where T: NumLike {
12732 type Output = InversePower<T>;
12733 fn mul(self, rhs: InverseEnergy<T>) -> Self::Output {
12734 InversePower{per_W: self.s * rhs.per_J}
12735 }
12736}
12737impl<T> core::ops::Mul<InverseEnergy<T>> for &Time<T> where T: NumLike {
12739 type Output = InversePower<T>;
12740 fn mul(self, rhs: InverseEnergy<T>) -> Self::Output {
12741 InversePower{per_W: self.s.clone() * rhs.per_J}
12742 }
12743}
12744impl<T> core::ops::Mul<&InverseEnergy<T>> for Time<T> where T: NumLike {
12746 type Output = InversePower<T>;
12747 fn mul(self, rhs: &InverseEnergy<T>) -> Self::Output {
12748 InversePower{per_W: self.s * rhs.per_J.clone()}
12749 }
12750}
12751impl<T> core::ops::Mul<&InverseEnergy<T>> for &Time<T> where T: NumLike {
12753 type Output = InversePower<T>;
12754 fn mul(self, rhs: &InverseEnergy<T>) -> Self::Output {
12755 InversePower{per_W: self.s.clone() * rhs.per_J.clone()}
12756 }
12757}
12758
12759impl<T> core::ops::Mul<InverseTorque<T>> for Time<T> where T: NumLike {
12762 type Output = InversePower<T>;
12763 fn mul(self, rhs: InverseTorque<T>) -> Self::Output {
12764 InversePower{per_W: self.s * rhs.per_Nm}
12765 }
12766}
12767impl<T> core::ops::Mul<InverseTorque<T>> for &Time<T> where T: NumLike {
12769 type Output = InversePower<T>;
12770 fn mul(self, rhs: InverseTorque<T>) -> Self::Output {
12771 InversePower{per_W: self.s.clone() * rhs.per_Nm}
12772 }
12773}
12774impl<T> core::ops::Mul<&InverseTorque<T>> for Time<T> where T: NumLike {
12776 type Output = InversePower<T>;
12777 fn mul(self, rhs: &InverseTorque<T>) -> Self::Output {
12778 InversePower{per_W: self.s * rhs.per_Nm.clone()}
12779 }
12780}
12781impl<T> core::ops::Mul<&InverseTorque<T>> for &Time<T> where T: NumLike {
12783 type Output = InversePower<T>;
12784 fn mul(self, rhs: &InverseTorque<T>) -> Self::Output {
12785 InversePower{per_W: self.s.clone() * rhs.per_Nm.clone()}
12786 }
12787}
12788
12789impl<T> core::ops::Div<InverseForce<T>> for Time<T> where T: NumLike {
12792 type Output = Momentum<T>;
12793 fn div(self, rhs: InverseForce<T>) -> Self::Output {
12794 Momentum{kgmps: self.s / rhs.per_N}
12795 }
12796}
12797impl<T> core::ops::Div<InverseForce<T>> for &Time<T> where T: NumLike {
12799 type Output = Momentum<T>;
12800 fn div(self, rhs: InverseForce<T>) -> Self::Output {
12801 Momentum{kgmps: self.s.clone() / rhs.per_N}
12802 }
12803}
12804impl<T> core::ops::Div<&InverseForce<T>> for Time<T> where T: NumLike {
12806 type Output = Momentum<T>;
12807 fn div(self, rhs: &InverseForce<T>) -> Self::Output {
12808 Momentum{kgmps: self.s / rhs.per_N.clone()}
12809 }
12810}
12811impl<T> core::ops::Div<&InverseForce<T>> for &Time<T> where T: NumLike {
12813 type Output = Momentum<T>;
12814 fn div(self, rhs: &InverseForce<T>) -> Self::Output {
12815 Momentum{kgmps: self.s.clone() / rhs.per_N.clone()}
12816 }
12817}
12818
12819impl<T> core::ops::Mul<InverseMomentum<T>> for Time<T> where T: NumLike {
12822 type Output = InverseForce<T>;
12823 fn mul(self, rhs: InverseMomentum<T>) -> Self::Output {
12824 InverseForce{per_N: self.s * rhs.s_per_kgm}
12825 }
12826}
12827impl<T> core::ops::Mul<InverseMomentum<T>> for &Time<T> where T: NumLike {
12829 type Output = InverseForce<T>;
12830 fn mul(self, rhs: InverseMomentum<T>) -> Self::Output {
12831 InverseForce{per_N: self.s.clone() * rhs.s_per_kgm}
12832 }
12833}
12834impl<T> core::ops::Mul<&InverseMomentum<T>> for Time<T> where T: NumLike {
12836 type Output = InverseForce<T>;
12837 fn mul(self, rhs: &InverseMomentum<T>) -> Self::Output {
12838 InverseForce{per_N: self.s * rhs.s_per_kgm.clone()}
12839 }
12840}
12841impl<T> core::ops::Mul<&InverseMomentum<T>> for &Time<T> where T: NumLike {
12843 type Output = InverseForce<T>;
12844 fn mul(self, rhs: &InverseMomentum<T>) -> Self::Output {
12845 InverseForce{per_N: self.s.clone() * rhs.s_per_kgm.clone()}
12846 }
12847}
12848
12849impl<T> core::ops::Div<InversePower<T>> for Time<T> where T: NumLike {
12852 type Output = Energy<T>;
12853 fn div(self, rhs: InversePower<T>) -> Self::Output {
12854 Energy{J: self.s / rhs.per_W}
12855 }
12856}
12857impl<T> core::ops::Div<InversePower<T>> for &Time<T> where T: NumLike {
12859 type Output = Energy<T>;
12860 fn div(self, rhs: InversePower<T>) -> Self::Output {
12861 Energy{J: self.s.clone() / rhs.per_W}
12862 }
12863}
12864impl<T> core::ops::Div<&InversePower<T>> for Time<T> where T: NumLike {
12866 type Output = Energy<T>;
12867 fn div(self, rhs: &InversePower<T>) -> Self::Output {
12868 Energy{J: self.s / rhs.per_W.clone()}
12869 }
12870}
12871impl<T> core::ops::Div<&InversePower<T>> for &Time<T> where T: NumLike {
12873 type Output = Energy<T>;
12874 fn div(self, rhs: &InversePower<T>) -> Self::Output {
12875 Energy{J: self.s.clone() / rhs.per_W.clone()}
12876 }
12877}
12878
12879impl<T> core::ops::Div<Momentum<T>> for Time<T> where T: NumLike {
12882 type Output = InverseForce<T>;
12883 fn div(self, rhs: Momentum<T>) -> Self::Output {
12884 InverseForce{per_N: self.s / rhs.kgmps}
12885 }
12886}
12887impl<T> core::ops::Div<Momentum<T>> for &Time<T> where T: NumLike {
12889 type Output = InverseForce<T>;
12890 fn div(self, rhs: Momentum<T>) -> Self::Output {
12891 InverseForce{per_N: self.s.clone() / rhs.kgmps}
12892 }
12893}
12894impl<T> core::ops::Div<&Momentum<T>> for Time<T> where T: NumLike {
12896 type Output = InverseForce<T>;
12897 fn div(self, rhs: &Momentum<T>) -> Self::Output {
12898 InverseForce{per_N: self.s / rhs.kgmps.clone()}
12899 }
12900}
12901impl<T> core::ops::Div<&Momentum<T>> for &Time<T> where T: NumLike {
12903 type Output = InverseForce<T>;
12904 fn div(self, rhs: &Momentum<T>) -> Self::Output {
12905 InverseForce{per_N: self.s.clone() / rhs.kgmps.clone()}
12906 }
12907}
12908
12909impl<T> core::ops::Mul<Power<T>> for Time<T> where T: NumLike {
12912 type Output = Energy<T>;
12913 fn mul(self, rhs: Power<T>) -> Self::Output {
12914 Energy{J: self.s * rhs.W}
12915 }
12916}
12917impl<T> core::ops::Mul<Power<T>> for &Time<T> where T: NumLike {
12919 type Output = Energy<T>;
12920 fn mul(self, rhs: Power<T>) -> Self::Output {
12921 Energy{J: self.s.clone() * rhs.W}
12922 }
12923}
12924impl<T> core::ops::Mul<&Power<T>> for Time<T> where T: NumLike {
12926 type Output = Energy<T>;
12927 fn mul(self, rhs: &Power<T>) -> Self::Output {
12928 Energy{J: self.s * rhs.W.clone()}
12929 }
12930}
12931impl<T> core::ops::Mul<&Power<T>> for &Time<T> where T: NumLike {
12933 type Output = Energy<T>;
12934 fn mul(self, rhs: &Power<T>) -> Self::Output {
12935 Energy{J: self.s.clone() * rhs.W.clone()}
12936 }
12937}
12938
12939impl<T> core::ops::Mul<TimePerDistance<T>> for Time<T> where T: NumLike {
12942 type Output = InverseAcceleration<T>;
12943 fn mul(self, rhs: TimePerDistance<T>) -> Self::Output {
12944 InverseAcceleration{s2pm: self.s * rhs.spm}
12945 }
12946}
12947impl<T> core::ops::Mul<TimePerDistance<T>> for &Time<T> where T: NumLike {
12949 type Output = InverseAcceleration<T>;
12950 fn mul(self, rhs: TimePerDistance<T>) -> Self::Output {
12951 InverseAcceleration{s2pm: self.s.clone() * rhs.spm}
12952 }
12953}
12954impl<T> core::ops::Mul<&TimePerDistance<T>> for Time<T> where T: NumLike {
12956 type Output = InverseAcceleration<T>;
12957 fn mul(self, rhs: &TimePerDistance<T>) -> Self::Output {
12958 InverseAcceleration{s2pm: self.s * rhs.spm.clone()}
12959 }
12960}
12961impl<T> core::ops::Mul<&TimePerDistance<T>> for &Time<T> where T: NumLike {
12963 type Output = InverseAcceleration<T>;
12964 fn mul(self, rhs: &TimePerDistance<T>) -> Self::Output {
12965 InverseAcceleration{s2pm: self.s.clone() * rhs.spm.clone()}
12966 }
12967}
12968
12969impl<T> core::ops::Div<TimePerDistance<T>> for Time<T> where T: NumLike {
12972 type Output = Distance<T>;
12973 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
12974 Distance{m: self.s / rhs.spm}
12975 }
12976}
12977impl<T> core::ops::Div<TimePerDistance<T>> for &Time<T> where T: NumLike {
12979 type Output = Distance<T>;
12980 fn div(self, rhs: TimePerDistance<T>) -> Self::Output {
12981 Distance{m: self.s.clone() / rhs.spm}
12982 }
12983}
12984impl<T> core::ops::Div<&TimePerDistance<T>> for Time<T> where T: NumLike {
12986 type Output = Distance<T>;
12987 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
12988 Distance{m: self.s / rhs.spm.clone()}
12989 }
12990}
12991impl<T> core::ops::Div<&TimePerDistance<T>> for &Time<T> where T: NumLike {
12993 type Output = Distance<T>;
12994 fn div(self, rhs: &TimePerDistance<T>) -> Self::Output {
12995 Distance{m: self.s.clone() / rhs.spm.clone()}
12996 }
12997}
12998
12999impl<T> core::ops::Mul<Velocity<T>> for Time<T> where T: NumLike {
13002 type Output = Distance<T>;
13003 fn mul(self, rhs: Velocity<T>) -> Self::Output {
13004 Distance{m: self.s * rhs.mps}
13005 }
13006}
13007impl<T> core::ops::Mul<Velocity<T>> for &Time<T> where T: NumLike {
13009 type Output = Distance<T>;
13010 fn mul(self, rhs: Velocity<T>) -> Self::Output {
13011 Distance{m: self.s.clone() * rhs.mps}
13012 }
13013}
13014impl<T> core::ops::Mul<&Velocity<T>> for Time<T> where T: NumLike {
13016 type Output = Distance<T>;
13017 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
13018 Distance{m: self.s * rhs.mps.clone()}
13019 }
13020}
13021impl<T> core::ops::Mul<&Velocity<T>> for &Time<T> where T: NumLike {
13023 type Output = Distance<T>;
13024 fn mul(self, rhs: &Velocity<T>) -> Self::Output {
13025 Distance{m: self.s.clone() * rhs.mps.clone()}
13026 }
13027}
13028
13029impl<T> core::ops::Div<Velocity<T>> for Time<T> where T: NumLike {
13032 type Output = InverseAcceleration<T>;
13033 fn div(self, rhs: Velocity<T>) -> Self::Output {
13034 InverseAcceleration{s2pm: self.s / rhs.mps}
13035 }
13036}
13037impl<T> core::ops::Div<Velocity<T>> for &Time<T> where T: NumLike {
13039 type Output = InverseAcceleration<T>;
13040 fn div(self, rhs: Velocity<T>) -> Self::Output {
13041 InverseAcceleration{s2pm: self.s.clone() / rhs.mps}
13042 }
13043}
13044impl<T> core::ops::Div<&Velocity<T>> for Time<T> where T: NumLike {
13046 type Output = InverseAcceleration<T>;
13047 fn div(self, rhs: &Velocity<T>) -> Self::Output {
13048 InverseAcceleration{s2pm: self.s / rhs.mps.clone()}
13049 }
13050}
13051impl<T> core::ops::Div<&Velocity<T>> for &Time<T> where T: NumLike {
13053 type Output = InverseAcceleration<T>;
13054 fn div(self, rhs: &Velocity<T>) -> Self::Output {
13055 InverseAcceleration{s2pm: self.s.clone() / rhs.mps.clone()}
13056 }
13057}
13058
13059impl<T> core::ops::Div<Time<T>> for f64 where T: NumLike+From<f64> {
13062 type Output = Frequency<T>;
13063 fn div(self, rhs: Time<T>) -> Self::Output {
13064 Frequency{Hz: T::from(self) / rhs.s}
13065 }
13066}
13067impl<T> core::ops::Div<Time<T>> for &f64 where T: NumLike+From<f64> {
13069 type Output = Frequency<T>;
13070 fn div(self, rhs: Time<T>) -> Self::Output {
13071 Frequency{Hz: T::from(self.clone()) / rhs.s}
13072 }
13073}
13074impl<T> core::ops::Div<&Time<T>> for f64 where T: NumLike+From<f64> {
13076 type Output = Frequency<T>;
13077 fn div(self, rhs: &Time<T>) -> Self::Output {
13078 Frequency{Hz: T::from(self) / rhs.s.clone()}
13079 }
13080}
13081impl<T> core::ops::Div<&Time<T>> for &f64 where T: NumLike+From<f64> {
13083 type Output = Frequency<T>;
13084 fn div(self, rhs: &Time<T>) -> Self::Output {
13085 Frequency{Hz: T::from(self.clone()) / rhs.s.clone()}
13086 }
13087}
13088
13089impl<T> core::ops::Div<Time<T>> for f32 where T: NumLike+From<f32> {
13092 type Output = Frequency<T>;
13093 fn div(self, rhs: Time<T>) -> Self::Output {
13094 Frequency{Hz: T::from(self) / rhs.s}
13095 }
13096}
13097impl<T> core::ops::Div<Time<T>> for &f32 where T: NumLike+From<f32> {
13099 type Output = Frequency<T>;
13100 fn div(self, rhs: Time<T>) -> Self::Output {
13101 Frequency{Hz: T::from(self.clone()) / rhs.s}
13102 }
13103}
13104impl<T> core::ops::Div<&Time<T>> for f32 where T: NumLike+From<f32> {
13106 type Output = Frequency<T>;
13107 fn div(self, rhs: &Time<T>) -> Self::Output {
13108 Frequency{Hz: T::from(self) / rhs.s.clone()}
13109 }
13110}
13111impl<T> core::ops::Div<&Time<T>> for &f32 where T: NumLike+From<f32> {
13113 type Output = Frequency<T>;
13114 fn div(self, rhs: &Time<T>) -> Self::Output {
13115 Frequency{Hz: T::from(self.clone()) / rhs.s.clone()}
13116 }
13117}
13118
13119impl<T> core::ops::Div<Time<T>> for i64 where T: NumLike+From<i64> {
13122 type Output = Frequency<T>;
13123 fn div(self, rhs: Time<T>) -> Self::Output {
13124 Frequency{Hz: T::from(self) / rhs.s}
13125 }
13126}
13127impl<T> core::ops::Div<Time<T>> for &i64 where T: NumLike+From<i64> {
13129 type Output = Frequency<T>;
13130 fn div(self, rhs: Time<T>) -> Self::Output {
13131 Frequency{Hz: T::from(self.clone()) / rhs.s}
13132 }
13133}
13134impl<T> core::ops::Div<&Time<T>> for i64 where T: NumLike+From<i64> {
13136 type Output = Frequency<T>;
13137 fn div(self, rhs: &Time<T>) -> Self::Output {
13138 Frequency{Hz: T::from(self) / rhs.s.clone()}
13139 }
13140}
13141impl<T> core::ops::Div<&Time<T>> for &i64 where T: NumLike+From<i64> {
13143 type Output = Frequency<T>;
13144 fn div(self, rhs: &Time<T>) -> Self::Output {
13145 Frequency{Hz: T::from(self.clone()) / rhs.s.clone()}
13146 }
13147}
13148
13149impl<T> core::ops::Div<Time<T>> for i32 where T: NumLike+From<i32> {
13152 type Output = Frequency<T>;
13153 fn div(self, rhs: Time<T>) -> Self::Output {
13154 Frequency{Hz: T::from(self) / rhs.s}
13155 }
13156}
13157impl<T> core::ops::Div<Time<T>> for &i32 where T: NumLike+From<i32> {
13159 type Output = Frequency<T>;
13160 fn div(self, rhs: Time<T>) -> Self::Output {
13161 Frequency{Hz: T::from(self.clone()) / rhs.s}
13162 }
13163}
13164impl<T> core::ops::Div<&Time<T>> for i32 where T: NumLike+From<i32> {
13166 type Output = Frequency<T>;
13167 fn div(self, rhs: &Time<T>) -> Self::Output {
13168 Frequency{Hz: T::from(self) / rhs.s.clone()}
13169 }
13170}
13171impl<T> core::ops::Div<&Time<T>> for &i32 where T: NumLike+From<i32> {
13173 type Output = Frequency<T>;
13174 fn div(self, rhs: &Time<T>) -> Self::Output {
13175 Frequency{Hz: T::from(self.clone()) / rhs.s.clone()}
13176 }
13177}
13178
13179#[cfg(feature="num-bigfloat")]
13182impl<T> core::ops::Div<Time<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
13183 type Output = Frequency<T>;
13184 fn div(self, rhs: Time<T>) -> Self::Output {
13185 Frequency{Hz: T::from(self) / rhs.s}
13186 }
13187}
13188#[cfg(feature="num-bigfloat")]
13190impl<T> core::ops::Div<Time<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
13191 type Output = Frequency<T>;
13192 fn div(self, rhs: Time<T>) -> Self::Output {
13193 Frequency{Hz: T::from(self.clone()) / rhs.s}
13194 }
13195}
13196#[cfg(feature="num-bigfloat")]
13198impl<T> core::ops::Div<&Time<T>> for num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
13199 type Output = Frequency<T>;
13200 fn div(self, rhs: &Time<T>) -> Self::Output {
13201 Frequency{Hz: T::from(self) / rhs.s.clone()}
13202 }
13203}
13204#[cfg(feature="num-bigfloat")]
13206impl<T> core::ops::Div<&Time<T>> for &num_bigfloat::BigFloat where T: NumLike+From<num_bigfloat::BigFloat> {
13207 type Output = Frequency<T>;
13208 fn div(self, rhs: &Time<T>) -> Self::Output {
13209 Frequency{Hz: T::from(self.clone()) / rhs.s.clone()}
13210 }
13211}
13212
13213#[cfg(feature="num-complex")]
13216impl<T> core::ops::Div<Time<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
13217 type Output = Frequency<T>;
13218 fn div(self, rhs: Time<T>) -> Self::Output {
13219 Frequency{Hz: T::from(self) / rhs.s}
13220 }
13221}
13222#[cfg(feature="num-complex")]
13224impl<T> core::ops::Div<Time<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
13225 type Output = Frequency<T>;
13226 fn div(self, rhs: Time<T>) -> Self::Output {
13227 Frequency{Hz: T::from(self.clone()) / rhs.s}
13228 }
13229}
13230#[cfg(feature="num-complex")]
13232impl<T> core::ops::Div<&Time<T>> for num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
13233 type Output = Frequency<T>;
13234 fn div(self, rhs: &Time<T>) -> Self::Output {
13235 Frequency{Hz: T::from(self) / rhs.s.clone()}
13236 }
13237}
13238#[cfg(feature="num-complex")]
13240impl<T> core::ops::Div<&Time<T>> for &num_complex::Complex32 where T: NumLike+From<num_complex::Complex32> {
13241 type Output = Frequency<T>;
13242 fn div(self, rhs: &Time<T>) -> Self::Output {
13243 Frequency{Hz: T::from(self.clone()) / rhs.s.clone()}
13244 }
13245}
13246
13247#[cfg(feature="num-complex")]
13250impl<T> core::ops::Div<Time<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
13251 type Output = Frequency<T>;
13252 fn div(self, rhs: Time<T>) -> Self::Output {
13253 Frequency{Hz: T::from(self) / rhs.s}
13254 }
13255}
13256#[cfg(feature="num-complex")]
13258impl<T> core::ops::Div<Time<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
13259 type Output = Frequency<T>;
13260 fn div(self, rhs: Time<T>) -> Self::Output {
13261 Frequency{Hz: T::from(self.clone()) / rhs.s}
13262 }
13263}
13264#[cfg(feature="num-complex")]
13266impl<T> core::ops::Div<&Time<T>> for num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
13267 type Output = Frequency<T>;
13268 fn div(self, rhs: &Time<T>) -> Self::Output {
13269 Frequency{Hz: T::from(self) / rhs.s.clone()}
13270 }
13271}
13272#[cfg(feature="num-complex")]
13274impl<T> core::ops::Div<&Time<T>> for &num_complex::Complex64 where T: NumLike+From<num_complex::Complex64> {
13275 type Output = Frequency<T>;
13276 fn div(self, rhs: &Time<T>) -> Self::Output {
13277 Frequency{Hz: T::from(self.clone()) / rhs.s.clone()}
13278 }
13279}
13280
13281
13282