@@ -182,14 +182,15 @@ A valid registry index meets the following criteria:
182
182
183
183
``` json
184
184
{
185
- "dl" : " https://my-crates-server.com/api/v1/crates" ,
185
+ "dl" : " https://my-crates-server.com/api/v1/crates/{crate}/{version}/download " ,
186
186
"api" : " https://my-crates-server.com/" ,
187
187
"allowed-registries" : [" https://github.com/rust-lang/crates.io-index" , " https://my-intranet:8080/index" ]
188
188
}
189
189
```
190
190
191
- The ` dl ` key is required specifies where Cargo can download the tarballs containing the source
192
- files of the crates listed in the registry.
191
+ The ` dl ` key is required and specifies where Cargo can download the tarballs containing the source
192
+ files of the crates listed in the registry. It is templated by the strings ` {crate} ` and
193
+ ` {version} ` which are replaced with the name and version of the crate to download, respectively.
193
194
194
195
The ` api ` key is optional and specifies where Cargo can find the API server that provides the
195
196
same API functionality that crates.io does today, such as publishing and searching. Without the
@@ -205,7 +206,9 @@ A valid registry index meets the following criteria:
205
206
- There will be a number of directories in the git repository.
206
207
- ` 1/ ` - holds files for all crates whose names have one letter.
207
208
- ` 2/ ` - holds files for all crates whose names have two letters.
208
- - ` 3/ ` - holds files for all crates whose names have three letters.
209
+ - ` 3/a ` etc - for all crates whose names have three letters, their files will
210
+ be in a directory named ` 3 ` , then a subdirectory named with the first letter
211
+ of their name.
209
212
- ` aa/aa/ ` etc - for all crates whose names have four or more letters, their
210
213
files will be in a directory named with the first and second letters of
211
214
their name, then in a subdirectory named with the third and fourth letters
@@ -270,7 +273,9 @@ A valid registry index meets the following criteria:
270
273
- ` default_features ` : whether the parent uses the default features of this dependency or not
271
274
- ` target ` : on which target this dependency is needed
272
275
- ` kind ` : can be ` normal ` , ` build ` , or ` dev ` to be a regular dependency, a build-time
273
- dependency, or a development dependency
276
+ dependency, or a development dependency. Note: this is a required field, but a small number of
277
+ entries exist in the crates.io index with either a missing or null ` kind ` field due to
278
+ implementation bugs.
274
279
275
280
If a dependency's registry is not specified, Cargo will assume the dependency can be located in the
276
281
current registry. By specifying the registry of a dependency in the index, cargo will have the
0 commit comments