##// END OF EJS Templates
rust-node: binary Node ID and conversion utilities...
Georges Racinet -
r44601:7f86426f default
parent child Browse files
Show More
@@ -0,0 +1,191 b''
1 // Copyright 2019-2020 Georges Racinet <georges.racinet@octobus.net>
2 //
3 // This software may be used and distributed according to the terms of the
4 // GNU General Public License version 2 or any later version.
5
6 //! Definitions and utilities for Revision nodes
7 //!
8 //! In Mercurial code base, it is customary to call "a node" the binary SHA
9 //! of a revision.
10
11 use hex::{self, FromHex, FromHexError};
12
13 /// The length in bytes of a `Node`
14 ///
15 /// This constant is meant to ease refactors of this module, and
16 /// are private so that calling code does not expect all nodes have
17 /// the same size, should we support several formats concurrently in
18 /// the future.
19 const NODE_BYTES_LENGTH: usize = 20;
20
21 /// The length in bytes of a `Node`
22 ///
23 /// see also `NODES_BYTES_LENGTH` about it being private.
24 const NODE_NYBBLES_LENGTH: usize = 2 * NODE_BYTES_LENGTH;
25
26 /// Private alias for readability and to ease future change
27 type NodeData = [u8; NODE_BYTES_LENGTH];
28
29 /// Binary revision SHA
30 ///
31 /// ## Future changes of hash size
32 ///
33 /// To accomodate future changes of hash size, Rust callers
34 /// should use the conversion methods at the boundaries (FFI, actual
35 /// computation of hashes and I/O) only, and only if required.
36 ///
37 /// All other callers outside of unit tests should just handle `Node` values
38 /// and never make any assumption on the actual length, using [`nybbles_len`]
39 /// if they need a loop boundary.
40 ///
41 /// All methods that create a `Node` either take a type that enforces
42 /// the size or fail immediately at runtime with [`ExactLengthRequired`].
43 ///
44 /// [`nybbles_len`]: #method.nybbles_len
45 /// [`ExactLengthRequired`]: struct.NodeError#variant.ExactLengthRequired
46 #[derive(Clone, Debug, PartialEq)]
47 pub struct Node {
48 data: NodeData,
49 }
50
51 /// The node value for NULL_REVISION
52 pub const NULL_NODE: Node = Node {
53 data: [0; NODE_BYTES_LENGTH],
54 };
55
56 impl From<NodeData> for Node {
57 fn from(data: NodeData) -> Node {
58 Node { data }
59 }
60 }
61
62 #[derive(Debug, PartialEq)]
63 pub enum NodeError {
64 ExactLengthRequired(usize, String),
65 HexError(FromHexError, String),
66 }
67
68 /// Low level utility function, also for prefixes
69 fn get_nybble(s: &[u8], i: usize) -> u8 {
70 if i % 2 == 0 {
71 s[i / 2] >> 4
72 } else {
73 s[i / 2] & 0x0f
74 }
75 }
76
77 impl Node {
78 /// Retrieve the `i`th half-byte of the binary data.
79 ///
80 /// This is also the `i`th hexadecimal digit in numeric form,
81 /// also called a [nybble](https://en.wikipedia.org/wiki/Nibble).
82 pub fn get_nybble(&self, i: usize) -> u8 {
83 get_nybble(&self.data, i)
84 }
85
86 /// Length of the data, in nybbles
87 pub fn nybbles_len(&self) -> usize {
88 // public exposure as an instance method only, so that we can
89 // easily support several sizes of hashes if needed in the future.
90 NODE_NYBBLES_LENGTH
91 }
92
93 /// Convert from hexadecimal string representation
94 ///
95 /// Exact length is required.
96 ///
97 /// To be used in FFI and I/O only, in order to facilitate future
98 /// changes of hash format.
99 pub fn from_hex(hex: &str) -> Result<Node, NodeError> {
100 Ok(NodeData::from_hex(hex)
101 .map_err(|e| NodeError::from((e, hex)))?
102 .into())
103 }
104
105 /// Convert to hexadecimal string representation
106 ///
107 /// To be used in FFI and I/O only, in order to facilitate future
108 /// changes of hash format.
109 pub fn encode_hex(&self) -> String {
110 hex::encode(self.data)
111 }
112
113 /// Provide access to binary data
114 ///
115 /// This is needed by FFI layers, for instance to return expected
116 /// binary values to Python.
117 pub fn as_bytes(&self) -> &[u8] {
118 &self.data
119 }
120 }
121
122 impl From<(FromHexError, &str)> for NodeError {
123 fn from(err_offender: (FromHexError, &str)) -> Self {
124 let (err, offender) = err_offender;
125 match err {
126 FromHexError::InvalidStringLength => {
127 NodeError::ExactLengthRequired(
128 NODE_NYBBLES_LENGTH,
129 offender.to_string(),
130 )
131 }
132 _ => NodeError::HexError(err, offender.to_string()),
133 }
134 }
135 }
136
137 #[cfg(test)]
138 mod tests {
139 use super::*;
140
141 fn sample_node() -> Node {
142 let mut data = [0; NODE_BYTES_LENGTH];
143 data.copy_from_slice(&[
144 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba,
145 0x98, 0x76, 0x54, 0x32, 0x10, 0xde, 0xad, 0xbe, 0xef,
146 ]);
147 data.into()
148 }
149
150 /// Pad an hexadecimal string to reach `NODE_NYBBLES_LENGTH`
151 ///
152 /// The padding is made with zeros
153 fn hex_pad_right(hex: &str) -> String {
154 let mut res = hex.to_string();
155 while res.len() < NODE_NYBBLES_LENGTH {
156 res.push('0');
157 }
158 res
159 }
160
161 fn sample_node_hex() -> String {
162 hex_pad_right("0123456789abcdeffedcba9876543210deadbeef")
163 }
164
165 #[test]
166 fn test_node_from_hex() {
167 assert_eq!(Node::from_hex(&sample_node_hex()), Ok(sample_node()));
168
169 let mut short = hex_pad_right("0123");
170 short.pop();
171 short.pop();
172 assert_eq!(
173 Node::from_hex(&short),
174 Err(NodeError::ExactLengthRequired(NODE_NYBBLES_LENGTH, short)),
175 );
176
177 let not_hex = hex_pad_right("012... oops");
178 assert_eq!(
179 Node::from_hex(&not_hex),
180 Err(NodeError::HexError(
181 FromHexError::InvalidHexCharacter { c: '.', index: 3 },
182 not_hex,
183 )),
184 );
185 }
186
187 #[test]
188 fn test_node_encode_hex() {
189 assert_eq!(sample_node().encode_hex(), sample_node_hex());
190 }
191 }
@@ -1,524 +1,531 b''
1 # This file is automatically @generated by Cargo.
1 # This file is automatically @generated by Cargo.
2 # It is not intended for manual editing.
2 # It is not intended for manual editing.
3 [[package]]
3 [[package]]
4 name = "aho-corasick"
4 name = "aho-corasick"
5 version = "0.7.6"
5 version = "0.7.6"
6 source = "registry+https://github.com/rust-lang/crates.io-index"
6 source = "registry+https://github.com/rust-lang/crates.io-index"
7 dependencies = [
7 dependencies = [
8 "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
8 "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
9 ]
9 ]
10
10
11 [[package]]
11 [[package]]
12 name = "arrayvec"
12 name = "arrayvec"
13 version = "0.4.12"
13 version = "0.4.12"
14 source = "registry+https://github.com/rust-lang/crates.io-index"
14 source = "registry+https://github.com/rust-lang/crates.io-index"
15 dependencies = [
15 dependencies = [
16 "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
16 "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
17 ]
17 ]
18
18
19 [[package]]
19 [[package]]
20 name = "autocfg"
20 name = "autocfg"
21 version = "0.1.6"
21 version = "0.1.6"
22 source = "registry+https://github.com/rust-lang/crates.io-index"
22 source = "registry+https://github.com/rust-lang/crates.io-index"
23
23
24 [[package]]
24 [[package]]
25 name = "bitflags"
25 name = "bitflags"
26 version = "1.2.1"
26 version = "1.2.1"
27 source = "registry+https://github.com/rust-lang/crates.io-index"
27 source = "registry+https://github.com/rust-lang/crates.io-index"
28
28
29 [[package]]
29 [[package]]
30 name = "byteorder"
30 name = "byteorder"
31 version = "1.3.2"
31 version = "1.3.2"
32 source = "registry+https://github.com/rust-lang/crates.io-index"
32 source = "registry+https://github.com/rust-lang/crates.io-index"
33
33
34 [[package]]
34 [[package]]
35 name = "c2-chacha"
35 name = "c2-chacha"
36 version = "0.2.2"
36 version = "0.2.2"
37 source = "registry+https://github.com/rust-lang/crates.io-index"
37 source = "registry+https://github.com/rust-lang/crates.io-index"
38 dependencies = [
38 dependencies = [
39 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
39 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
40 "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
40 "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
41 ]
41 ]
42
42
43 [[package]]
43 [[package]]
44 name = "cfg-if"
44 name = "cfg-if"
45 version = "0.1.10"
45 version = "0.1.10"
46 source = "registry+https://github.com/rust-lang/crates.io-index"
46 source = "registry+https://github.com/rust-lang/crates.io-index"
47
47
48 [[package]]
48 [[package]]
49 name = "cloudabi"
49 name = "cloudabi"
50 version = "0.0.3"
50 version = "0.0.3"
51 source = "registry+https://github.com/rust-lang/crates.io-index"
51 source = "registry+https://github.com/rust-lang/crates.io-index"
52 dependencies = [
52 dependencies = [
53 "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
53 "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
54 ]
54 ]
55
55
56 [[package]]
56 [[package]]
57 name = "cpython"
57 name = "cpython"
58 version = "0.3.0"
58 version = "0.3.0"
59 source = "registry+https://github.com/rust-lang/crates.io-index"
59 source = "registry+https://github.com/rust-lang/crates.io-index"
60 dependencies = [
60 dependencies = [
61 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
61 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
62 "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
62 "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
63 "python27-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
63 "python27-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
64 "python3-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
64 "python3-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
65 ]
65 ]
66
66
67 [[package]]
67 [[package]]
68 name = "crossbeam-deque"
68 name = "crossbeam-deque"
69 version = "0.7.1"
69 version = "0.7.1"
70 source = "registry+https://github.com/rust-lang/crates.io-index"
70 source = "registry+https://github.com/rust-lang/crates.io-index"
71 dependencies = [
71 dependencies = [
72 "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
72 "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
73 "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
73 "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
74 ]
74 ]
75
75
76 [[package]]
76 [[package]]
77 name = "crossbeam-epoch"
77 name = "crossbeam-epoch"
78 version = "0.7.2"
78 version = "0.7.2"
79 source = "registry+https://github.com/rust-lang/crates.io-index"
79 source = "registry+https://github.com/rust-lang/crates.io-index"
80 dependencies = [
80 dependencies = [
81 "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
81 "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
82 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
82 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
83 "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
83 "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
84 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
84 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
85 "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
85 "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
86 "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
86 "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
87 ]
87 ]
88
88
89 [[package]]
89 [[package]]
90 name = "crossbeam-queue"
90 name = "crossbeam-queue"
91 version = "0.1.2"
91 version = "0.1.2"
92 source = "registry+https://github.com/rust-lang/crates.io-index"
92 source = "registry+https://github.com/rust-lang/crates.io-index"
93 dependencies = [
93 dependencies = [
94 "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
94 "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
95 ]
95 ]
96
96
97 [[package]]
97 [[package]]
98 name = "crossbeam-utils"
98 name = "crossbeam-utils"
99 version = "0.6.6"
99 version = "0.6.6"
100 source = "registry+https://github.com/rust-lang/crates.io-index"
100 source = "registry+https://github.com/rust-lang/crates.io-index"
101 dependencies = [
101 dependencies = [
102 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
102 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
103 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
103 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
104 ]
104 ]
105
105
106 [[package]]
106 [[package]]
107 name = "either"
107 name = "either"
108 version = "1.5.3"
108 version = "1.5.3"
109 source = "registry+https://github.com/rust-lang/crates.io-index"
109 source = "registry+https://github.com/rust-lang/crates.io-index"
110
110
111 [[package]]
111 [[package]]
112 name = "fuchsia-cprng"
112 name = "fuchsia-cprng"
113 version = "0.1.1"
113 version = "0.1.1"
114 source = "registry+https://github.com/rust-lang/crates.io-index"
114 source = "registry+https://github.com/rust-lang/crates.io-index"
115
115
116 [[package]]
116 [[package]]
117 name = "getrandom"
117 name = "getrandom"
118 version = "0.1.12"
118 version = "0.1.12"
119 source = "registry+https://github.com/rust-lang/crates.io-index"
119 source = "registry+https://github.com/rust-lang/crates.io-index"
120 dependencies = [
120 dependencies = [
121 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
121 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
122 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
122 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
123 "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
123 "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
124 ]
124 ]
125
125
126 [[package]]
126 [[package]]
127 name = "hex"
128 version = "0.4.0"
129 source = "registry+https://github.com/rust-lang/crates.io-index"
130
131 [[package]]
127 name = "hg-core"
132 name = "hg-core"
128 version = "0.1.0"
133 version = "0.1.0"
129 dependencies = [
134 dependencies = [
130 "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
135 "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
136 "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
131 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
137 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
132 "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
138 "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
133 "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
139 "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
134 "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
140 "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
135 "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
141 "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
136 "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
142 "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
137 "twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
143 "twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
138 ]
144 ]
139
145
140 [[package]]
146 [[package]]
141 name = "hg-cpython"
147 name = "hg-cpython"
142 version = "0.1.0"
148 version = "0.1.0"
143 dependencies = [
149 dependencies = [
144 "cpython 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
150 "cpython 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
145 "hg-core 0.1.0",
151 "hg-core 0.1.0",
146 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
152 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
147 ]
153 ]
148
154
149 [[package]]
155 [[package]]
150 name = "hgdirectffi"
156 name = "hgdirectffi"
151 version = "0.1.0"
157 version = "0.1.0"
152 dependencies = [
158 dependencies = [
153 "hg-core 0.1.0",
159 "hg-core 0.1.0",
154 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
160 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
155 ]
161 ]
156
162
157 [[package]]
163 [[package]]
158 name = "lazy_static"
164 name = "lazy_static"
159 version = "1.4.0"
165 version = "1.4.0"
160 source = "registry+https://github.com/rust-lang/crates.io-index"
166 source = "registry+https://github.com/rust-lang/crates.io-index"
161
167
162 [[package]]
168 [[package]]
163 name = "libc"
169 name = "libc"
164 version = "0.2.64"
170 version = "0.2.64"
165 source = "registry+https://github.com/rust-lang/crates.io-index"
171 source = "registry+https://github.com/rust-lang/crates.io-index"
166
172
167 [[package]]
173 [[package]]
168 name = "memchr"
174 name = "memchr"
169 version = "2.2.1"
175 version = "2.2.1"
170 source = "registry+https://github.com/rust-lang/crates.io-index"
176 source = "registry+https://github.com/rust-lang/crates.io-index"
171
177
172 [[package]]
178 [[package]]
173 name = "memoffset"
179 name = "memoffset"
174 version = "0.5.1"
180 version = "0.5.1"
175 source = "registry+https://github.com/rust-lang/crates.io-index"
181 source = "registry+https://github.com/rust-lang/crates.io-index"
176 dependencies = [
182 dependencies = [
177 "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
183 "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
178 ]
184 ]
179
185
180 [[package]]
186 [[package]]
181 name = "nodrop"
187 name = "nodrop"
182 version = "0.1.14"
188 version = "0.1.14"
183 source = "registry+https://github.com/rust-lang/crates.io-index"
189 source = "registry+https://github.com/rust-lang/crates.io-index"
184
190
185 [[package]]
191 [[package]]
186 name = "num-traits"
192 name = "num-traits"
187 version = "0.2.8"
193 version = "0.2.8"
188 source = "registry+https://github.com/rust-lang/crates.io-index"
194 source = "registry+https://github.com/rust-lang/crates.io-index"
189 dependencies = [
195 dependencies = [
190 "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
196 "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
191 ]
197 ]
192
198
193 [[package]]
199 [[package]]
194 name = "num_cpus"
200 name = "num_cpus"
195 version = "1.10.1"
201 version = "1.10.1"
196 source = "registry+https://github.com/rust-lang/crates.io-index"
202 source = "registry+https://github.com/rust-lang/crates.io-index"
197 dependencies = [
203 dependencies = [
198 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
204 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
199 ]
205 ]
200
206
201 [[package]]
207 [[package]]
202 name = "ppv-lite86"
208 name = "ppv-lite86"
203 version = "0.2.5"
209 version = "0.2.5"
204 source = "registry+https://github.com/rust-lang/crates.io-index"
210 source = "registry+https://github.com/rust-lang/crates.io-index"
205
211
206 [[package]]
212 [[package]]
207 name = "python27-sys"
213 name = "python27-sys"
208 version = "0.3.0"
214 version = "0.3.0"
209 source = "registry+https://github.com/rust-lang/crates.io-index"
215 source = "registry+https://github.com/rust-lang/crates.io-index"
210 dependencies = [
216 dependencies = [
211 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
217 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
212 "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
218 "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
213 ]
219 ]
214
220
215 [[package]]
221 [[package]]
216 name = "python3-sys"
222 name = "python3-sys"
217 version = "0.3.0"
223 version = "0.3.0"
218 source = "registry+https://github.com/rust-lang/crates.io-index"
224 source = "registry+https://github.com/rust-lang/crates.io-index"
219 dependencies = [
225 dependencies = [
220 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
226 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
221 "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
227 "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
222 ]
228 ]
223
229
224 [[package]]
230 [[package]]
225 name = "rand"
231 name = "rand"
226 version = "0.6.5"
232 version = "0.6.5"
227 source = "registry+https://github.com/rust-lang/crates.io-index"
233 source = "registry+https://github.com/rust-lang/crates.io-index"
228 dependencies = [
234 dependencies = [
229 "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
235 "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
230 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
236 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
231 "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
237 "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
232 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
238 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
233 "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
239 "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
234 "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
240 "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
235 "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
241 "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
236 "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
242 "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
237 "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
243 "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
238 "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
244 "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
239 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
245 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
240 ]
246 ]
241
247
242 [[package]]
248 [[package]]
243 name = "rand"
249 name = "rand"
244 version = "0.7.2"
250 version = "0.7.2"
245 source = "registry+https://github.com/rust-lang/crates.io-index"
251 source = "registry+https://github.com/rust-lang/crates.io-index"
246 dependencies = [
252 dependencies = [
247 "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
253 "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
248 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
254 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
249 "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
255 "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
250 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
256 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
251 "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
257 "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
252 ]
258 ]
253
259
254 [[package]]
260 [[package]]
255 name = "rand_chacha"
261 name = "rand_chacha"
256 version = "0.1.1"
262 version = "0.1.1"
257 source = "registry+https://github.com/rust-lang/crates.io-index"
263 source = "registry+https://github.com/rust-lang/crates.io-index"
258 dependencies = [
264 dependencies = [
259 "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
265 "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
260 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
266 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
261 ]
267 ]
262
268
263 [[package]]
269 [[package]]
264 name = "rand_chacha"
270 name = "rand_chacha"
265 version = "0.2.1"
271 version = "0.2.1"
266 source = "registry+https://github.com/rust-lang/crates.io-index"
272 source = "registry+https://github.com/rust-lang/crates.io-index"
267 dependencies = [
273 dependencies = [
268 "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
274 "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
269 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
275 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
270 ]
276 ]
271
277
272 [[package]]
278 [[package]]
273 name = "rand_core"
279 name = "rand_core"
274 version = "0.3.1"
280 version = "0.3.1"
275 source = "registry+https://github.com/rust-lang/crates.io-index"
281 source = "registry+https://github.com/rust-lang/crates.io-index"
276 dependencies = [
282 dependencies = [
277 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
283 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
278 ]
284 ]
279
285
280 [[package]]
286 [[package]]
281 name = "rand_core"
287 name = "rand_core"
282 version = "0.4.2"
288 version = "0.4.2"
283 source = "registry+https://github.com/rust-lang/crates.io-index"
289 source = "registry+https://github.com/rust-lang/crates.io-index"
284
290
285 [[package]]
291 [[package]]
286 name = "rand_core"
292 name = "rand_core"
287 version = "0.5.1"
293 version = "0.5.1"
288 source = "registry+https://github.com/rust-lang/crates.io-index"
294 source = "registry+https://github.com/rust-lang/crates.io-index"
289 dependencies = [
295 dependencies = [
290 "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
296 "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
291 ]
297 ]
292
298
293 [[package]]
299 [[package]]
294 name = "rand_hc"
300 name = "rand_hc"
295 version = "0.1.0"
301 version = "0.1.0"
296 source = "registry+https://github.com/rust-lang/crates.io-index"
302 source = "registry+https://github.com/rust-lang/crates.io-index"
297 dependencies = [
303 dependencies = [
298 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
304 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
299 ]
305 ]
300
306
301 [[package]]
307 [[package]]
302 name = "rand_hc"
308 name = "rand_hc"
303 version = "0.2.0"
309 version = "0.2.0"
304 source = "registry+https://github.com/rust-lang/crates.io-index"
310 source = "registry+https://github.com/rust-lang/crates.io-index"
305 dependencies = [
311 dependencies = [
306 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
312 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
307 ]
313 ]
308
314
309 [[package]]
315 [[package]]
310 name = "rand_isaac"
316 name = "rand_isaac"
311 version = "0.1.1"
317 version = "0.1.1"
312 source = "registry+https://github.com/rust-lang/crates.io-index"
318 source = "registry+https://github.com/rust-lang/crates.io-index"
313 dependencies = [
319 dependencies = [
314 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
320 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
315 ]
321 ]
316
322
317 [[package]]
323 [[package]]
318 name = "rand_jitter"
324 name = "rand_jitter"
319 version = "0.1.4"
325 version = "0.1.4"
320 source = "registry+https://github.com/rust-lang/crates.io-index"
326 source = "registry+https://github.com/rust-lang/crates.io-index"
321 dependencies = [
327 dependencies = [
322 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
328 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
323 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
329 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
324 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
330 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
325 ]
331 ]
326
332
327 [[package]]
333 [[package]]
328 name = "rand_os"
334 name = "rand_os"
329 version = "0.1.3"
335 version = "0.1.3"
330 source = "registry+https://github.com/rust-lang/crates.io-index"
336 source = "registry+https://github.com/rust-lang/crates.io-index"
331 dependencies = [
337 dependencies = [
332 "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
338 "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
333 "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
339 "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
334 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
340 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)",
335 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
341 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
336 "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
342 "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
337 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
343 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
338 ]
344 ]
339
345
340 [[package]]
346 [[package]]
341 name = "rand_pcg"
347 name = "rand_pcg"
342 version = "0.1.2"
348 version = "0.1.2"
343 source = "registry+https://github.com/rust-lang/crates.io-index"
349 source = "registry+https://github.com/rust-lang/crates.io-index"
344 dependencies = [
350 dependencies = [
345 "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
351 "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
346 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
352 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
347 ]
353 ]
348
354
349 [[package]]
355 [[package]]
350 name = "rand_xorshift"
356 name = "rand_xorshift"
351 version = "0.1.1"
357 version = "0.1.1"
352 source = "registry+https://github.com/rust-lang/crates.io-index"
358 source = "registry+https://github.com/rust-lang/crates.io-index"
353 dependencies = [
359 dependencies = [
354 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
360 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
355 ]
361 ]
356
362
357 [[package]]
363 [[package]]
358 name = "rayon"
364 name = "rayon"
359 version = "1.2.0"
365 version = "1.2.0"
360 source = "registry+https://github.com/rust-lang/crates.io-index"
366 source = "registry+https://github.com/rust-lang/crates.io-index"
361 dependencies = [
367 dependencies = [
362 "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
368 "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
363 "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
369 "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
364 "rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
370 "rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
365 ]
371 ]
366
372
367 [[package]]
373 [[package]]
368 name = "rayon-core"
374 name = "rayon-core"
369 version = "1.6.0"
375 version = "1.6.0"
370 source = "registry+https://github.com/rust-lang/crates.io-index"
376 source = "registry+https://github.com/rust-lang/crates.io-index"
371 dependencies = [
377 dependencies = [
372 "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
378 "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
373 "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
379 "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
374 "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
380 "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
375 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
381 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
376 "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
382 "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
377 ]
383 ]
378
384
379 [[package]]
385 [[package]]
380 name = "rdrand"
386 name = "rdrand"
381 version = "0.4.0"
387 version = "0.4.0"
382 source = "registry+https://github.com/rust-lang/crates.io-index"
388 source = "registry+https://github.com/rust-lang/crates.io-index"
383 dependencies = [
389 dependencies = [
384 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
390 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
385 ]
391 ]
386
392
387 [[package]]
393 [[package]]
388 name = "regex"
394 name = "regex"
389 version = "1.3.1"
395 version = "1.3.1"
390 source = "registry+https://github.com/rust-lang/crates.io-index"
396 source = "registry+https://github.com/rust-lang/crates.io-index"
391 dependencies = [
397 dependencies = [
392 "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
398 "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
393 "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
399 "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
394 "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
400 "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
395 "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
401 "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
396 ]
402 ]
397
403
398 [[package]]
404 [[package]]
399 name = "regex-syntax"
405 name = "regex-syntax"
400 version = "0.6.12"
406 version = "0.6.12"
401 source = "registry+https://github.com/rust-lang/crates.io-index"
407 source = "registry+https://github.com/rust-lang/crates.io-index"
402
408
403 [[package]]
409 [[package]]
404 name = "rustc_version"
410 name = "rustc_version"
405 version = "0.2.3"
411 version = "0.2.3"
406 source = "registry+https://github.com/rust-lang/crates.io-index"
412 source = "registry+https://github.com/rust-lang/crates.io-index"
407 dependencies = [
413 dependencies = [
408 "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
414 "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
409 ]
415 ]
410
416
411 [[package]]
417 [[package]]
412 name = "scopeguard"
418 name = "scopeguard"
413 version = "1.0.0"
419 version = "1.0.0"
414 source = "registry+https://github.com/rust-lang/crates.io-index"
420 source = "registry+https://github.com/rust-lang/crates.io-index"
415
421
416 [[package]]
422 [[package]]
417 name = "semver"
423 name = "semver"
418 version = "0.9.0"
424 version = "0.9.0"
419 source = "registry+https://github.com/rust-lang/crates.io-index"
425 source = "registry+https://github.com/rust-lang/crates.io-index"
420 dependencies = [
426 dependencies = [
421 "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
427 "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
422 ]
428 ]
423
429
424 [[package]]
430 [[package]]
425 name = "semver-parser"
431 name = "semver-parser"
426 version = "0.7.0"
432 version = "0.7.0"
427 source = "registry+https://github.com/rust-lang/crates.io-index"
433 source = "registry+https://github.com/rust-lang/crates.io-index"
428
434
429 [[package]]
435 [[package]]
430 name = "thread_local"
436 name = "thread_local"
431 version = "0.3.6"
437 version = "0.3.6"
432 source = "registry+https://github.com/rust-lang/crates.io-index"
438 source = "registry+https://github.com/rust-lang/crates.io-index"
433 dependencies = [
439 dependencies = [
434 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
440 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
435 ]
441 ]
436
442
437 [[package]]
443 [[package]]
438 name = "twox-hash"
444 name = "twox-hash"
439 version = "1.5.0"
445 version = "1.5.0"
440 source = "registry+https://github.com/rust-lang/crates.io-index"
446 source = "registry+https://github.com/rust-lang/crates.io-index"
441 dependencies = [
447 dependencies = [
442 "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
448 "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
443 ]
449 ]
444
450
445 [[package]]
451 [[package]]
446 name = "wasi"
452 name = "wasi"
447 version = "0.7.0"
453 version = "0.7.0"
448 source = "registry+https://github.com/rust-lang/crates.io-index"
454 source = "registry+https://github.com/rust-lang/crates.io-index"
449
455
450 [[package]]
456 [[package]]
451 name = "winapi"
457 name = "winapi"
452 version = "0.3.8"
458 version = "0.3.8"
453 source = "registry+https://github.com/rust-lang/crates.io-index"
459 source = "registry+https://github.com/rust-lang/crates.io-index"
454 dependencies = [
460 dependencies = [
455 "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
461 "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
456 "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
462 "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
457 ]
463 ]
458
464
459 [[package]]
465 [[package]]
460 name = "winapi-i686-pc-windows-gnu"
466 name = "winapi-i686-pc-windows-gnu"
461 version = "0.4.0"
467 version = "0.4.0"
462 source = "registry+https://github.com/rust-lang/crates.io-index"
468 source = "registry+https://github.com/rust-lang/crates.io-index"
463
469
464 [[package]]
470 [[package]]
465 name = "winapi-x86_64-pc-windows-gnu"
471 name = "winapi-x86_64-pc-windows-gnu"
466 version = "0.4.0"
472 version = "0.4.0"
467 source = "registry+https://github.com/rust-lang/crates.io-index"
473 source = "registry+https://github.com/rust-lang/crates.io-index"
468
474
469 [metadata]
475 [metadata]
470 "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
476 "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
471 "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9"
477 "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9"
472 "checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
478 "checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
473 "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
479 "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
474 "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
480 "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
475 "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101"
481 "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101"
476 "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
482 "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
477 "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
483 "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
478 "checksum cpython 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85532c648315aeb0829ad216a6a29aa3212cf9319bc7f6daf1404aa0bdd1485f"
484 "checksum cpython 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85532c648315aeb0829ad216a6a29aa3212cf9319bc7f6daf1404aa0bdd1485f"
479 "checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71"
485 "checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71"
480 "checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9"
486 "checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9"
481 "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b"
487 "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b"
482 "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
488 "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
483 "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"
489 "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"
484 "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
490 "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
485 "checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571"
491 "checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571"
492 "checksum hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e"
486 "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
493 "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
487 "checksum libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)" = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c"
494 "checksum libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)" = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c"
488 "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
495 "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
489 "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f"
496 "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f"
490 "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
497 "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
491 "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32"
498 "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32"
492 "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273"
499 "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273"
493 "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b"
500 "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b"
494 "checksum python27-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "372555e88a6bc8109eb641380240dc8d25a128fc48363ec9075664daadffdd5b"
501 "checksum python27-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "372555e88a6bc8109eb641380240dc8d25a128fc48363ec9075664daadffdd5b"
495 "checksum python3-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f3a8ebed3f1201fda179f3960609dbbc10cd8c75e9f2afcb03788278f367d8ea"
502 "checksum python3-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f3a8ebed3f1201fda179f3960609dbbc10cd8c75e9f2afcb03788278f367d8ea"
496 "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
503 "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
497 "checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412"
504 "checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412"
498 "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
505 "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
499 "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853"
506 "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853"
500 "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
507 "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
501 "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
508 "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
502 "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
509 "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
503 "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
510 "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
504 "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
511 "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
505 "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
512 "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
506 "checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"
513 "checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"
507 "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
514 "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
508 "checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
515 "checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
509 "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
516 "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
510 "checksum rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123"
517 "checksum rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123"
511 "checksum rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b"
518 "checksum rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b"
512 "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
519 "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
513 "checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd"
520 "checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd"
514 "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716"
521 "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716"
515 "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
522 "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
516 "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d"
523 "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d"
517 "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
524 "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
518 "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
525 "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
519 "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
526 "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
520 "checksum twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56"
527 "checksum twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56"
521 "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d"
528 "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d"
522 "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
529 "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
523 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
530 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
524 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
531 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
@@ -1,19 +1,20 b''
1 [package]
1 [package]
2 name = "hg-core"
2 name = "hg-core"
3 version = "0.1.0"
3 version = "0.1.0"
4 authors = ["Georges Racinet <gracinet@anybox.fr>"]
4 authors = ["Georges Racinet <gracinet@anybox.fr>"]
5 description = "Mercurial pure Rust core library, with no assumption on Python bindings (FFI)"
5 description = "Mercurial pure Rust core library, with no assumption on Python bindings (FFI)"
6 edition = "2018"
6 edition = "2018"
7
7
8 [lib]
8 [lib]
9 name = "hg"
9 name = "hg"
10
10
11 [dependencies]
11 [dependencies]
12 byteorder = "1.3.1"
12 byteorder = "1.3.1"
13 hex = "0.4.0"
13 lazy_static = "1.3.0"
14 lazy_static = "1.3.0"
14 memchr = "2.2.0"
15 memchr = "2.2.0"
15 rand = "0.6.5"
16 rand = "0.6.5"
16 rand_pcg = "0.1.1"
17 rand_pcg = "0.1.1"
17 rayon = "1.2.0"
18 rayon = "1.2.0"
18 regex = "1.1.0"
19 regex = "1.1.0"
19 twox-hash = "1.5.0"
20 twox-hash = "1.5.0"
@@ -1,40 +1,42 b''
1 // Copyright 2018-2020 Georges Racinet <georges.racinet@octobus.net>
1 // Copyright 2018-2020 Georges Racinet <georges.racinet@octobus.net>
2 // and Mercurial contributors
2 // and Mercurial contributors
3 //
3 //
4 // This software may be used and distributed according to the terms of the
4 // This software may be used and distributed according to the terms of the
5 // GNU General Public License version 2 or any later version.
5 // GNU General Public License version 2 or any later version.
6 //! Mercurial concepts for handling revision history
6 //! Mercurial concepts for handling revision history
7
7
8 pub mod node;
8 pub mod nodemap;
9 pub mod nodemap;
10 pub use node::{Node, NodeError};
9
11
10 /// Mercurial revision numbers
12 /// Mercurial revision numbers
11 ///
13 ///
12 /// As noted in revlog.c, revision numbers are actually encoded in
14 /// As noted in revlog.c, revision numbers are actually encoded in
13 /// 4 bytes, and are liberally converted to ints, whence the i32
15 /// 4 bytes, and are liberally converted to ints, whence the i32
14 pub type Revision = i32;
16 pub type Revision = i32;
15
17
16 /// Marker expressing the absence of a parent
18 /// Marker expressing the absence of a parent
17 ///
19 ///
18 /// Independently of the actual representation, `NULL_REVISION` is guaranteed
20 /// Independently of the actual representation, `NULL_REVISION` is guaranteed
19 /// to be smaller than all existing revisions.
21 /// to be smaller than all existing revisions.
20 pub const NULL_REVISION: Revision = -1;
22 pub const NULL_REVISION: Revision = -1;
21
23
22 /// Same as `mercurial.node.wdirrev`
24 /// Same as `mercurial.node.wdirrev`
23 ///
25 ///
24 /// This is also equal to `i32::max_value()`, but it's better to spell
26 /// This is also equal to `i32::max_value()`, but it's better to spell
25 /// it out explicitely, same as in `mercurial.node`
27 /// it out explicitely, same as in `mercurial.node`
26 pub const WORKING_DIRECTORY_REVISION: Revision = 0x7fffffff;
28 pub const WORKING_DIRECTORY_REVISION: Revision = 0x7fffffff;
27
29
28 /// The simplest expression of what we need of Mercurial DAGs.
30 /// The simplest expression of what we need of Mercurial DAGs.
29 pub trait Graph {
31 pub trait Graph {
30 /// Return the two parents of the given `Revision`.
32 /// Return the two parents of the given `Revision`.
31 ///
33 ///
32 /// Each of the parents can be independently `NULL_REVISION`
34 /// Each of the parents can be independently `NULL_REVISION`
33 fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError>;
35 fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError>;
34 }
36 }
35
37
36 #[derive(Clone, Debug, PartialEq)]
38 #[derive(Clone, Debug, PartialEq)]
37 pub enum GraphError {
39 pub enum GraphError {
38 ParentOutOfRange(Revision),
40 ParentOutOfRange(Revision),
39 WorkingDirectoryUnsupported,
41 WorkingDirectoryUnsupported,
40 }
42 }
General Comments 0
You need to be logged in to leave comments. Login now