1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// lib.rs : base-traits
//! General-purpose traits for generic Rust programming.
//!
//! The crate supplies small traits for concepts that are
//! useful across unrelated types, including [`IsEmpty`],
//! [`Len`], [`ToF64`], and [`Zero`]. Implementations for
//! built-in and standard-library types are controlled by
//! feature flags so consumers can choose the API surface
//! they need.
//!
//! # Example
//!
//! ```
//! use base_traits::ToF64;
//!
//! struct Price(f64);
//!
//! impl ToF64 for Price {
//! fn to_f64(&self) -> f64 {
//! self.0
//! }
//! }
//!
//! let price = Price(12.50);
//! assert_eq!(12.50, price.to_f64());
//! ```
//!
//! The default feature set enables the common built-in and
//! standard-library implementations. The `"full"` feature
//! enables the broader set, including the experimental
//! process-type implementations. Use `"nostd"` when the
//! standard library is unavailable.
// /////////////////////////////////////////////////////////
// crate-level feature definitions
// /////////////////////////////////////////////////////////
// crate-level feature discrimination
// /////////////////////////////////////////////////////////
// imports
pub
declare_and_publish!;
// ///////////////////////////// end of file //////////////////////////// //