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
use Hasher;
use Deref;
/// Trait used for delegating [`Hash`] in [`IonData`](crate::IonData).
/// Implementations of [`IonDataHash`] must be consistent with [`IonEq`](crate::ion_data::IonEq).
///
/// This is _not_ the Ion Hash algorithm. Do not write any code that depends on a specific hash
/// being produced by a particular value. Do not expect that the hashes will be stable between
/// two runs of the same application. The only guarantee is that it is consistent with
/// [`IonEq`](crate::ion_data::IonEq)
///
/// This is called `IonDataHash` to avoid ambiguity with the Ion Hash algorithm and its
/// implementation in this crate.
pub
/// In a roundabout way, implements IonDataHash for [`f64`].
///
/// We cannot implement [`IonDataHash`] directly on [`f64`]. If [`IonDataHash`] is implemented directly
/// on [`f64`], then _any_ blanket impl of [`IonDataHash`] for a standard library trait will cause
/// `error[E0119]: conflicting implementations of trait` because [`f64`] is an external type (and
/// "upstream crates may add a new impl of trait `std::ops::Deref` for type `f64` in future versions").
pub
/// In a roundabout way, implements IonDataHash for [`bool`].
///
/// See docs for [`crate::ion_data::ion_data_hash_f64`] for general rationale. Even though the implementation is trivial,
/// this function exists to help convey the intention of using Ion equivalence at the call site.
pub