Skip to content

Commit a648bb5

Browse files
committed
Intra-doc links and format_version
1 parent 6f9c454 commit a648bb5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

text/0000-rustdoc-json.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,14 @@ local crate, as well as some information about external items that are referred
208208

209209
Name | Type | Description
210210
----------|---------|------------------------------------------------------------------------------
211-
`name` | String | (*Optional*) The name of the crate. If `--crate-name` is not given, based on the filename.
211+
`name` | String | The name of the crate. If `--crate-name` is not given, the filename is used.
212212
`version` | String | (*Optional*) The version string given to `--crate-version`, if any.
213213
`includes_private` | bool | Whether or not the output includes private items.
214214
`root` | [ID](#ID) | The ID of the root module Item.
215215
`index` | Map<[ID](#ID), [Item](#Item)> | A collection of all Items in the crate[\*](#resolving-ids).
216216
`paths` | Map<[ID](#ID), [ItemSummary](#ItemSummary)> | Maps all IDs (even external ones[\*](#resolving-ids)) to a brief description including their name, crate of origin, and kind.
217217
`extern_crates` | Map<int, [ExternalCrate](#ExternalCrate)> | A map of "crate numbers" to metadata about that crate.
218+
`format_version` | int | The version of the structure of this blob. The structure described by this RFC will be version `1`, and it will be changed if incompatible changes are ever made.
218219

219220
### Resolving IDs
220221

@@ -258,8 +259,8 @@ Name | Type | Description
258259
`visibility` | String | `"default"`, `"public"`, `"crate"`, or `"restricted"` (`pub(path)`).
259260
`restricted_path` | String | (*Optional*) If `visibility == "restricted"`, this field contains the path that it's restricted to.
260261
`docs` | String | The extracted documentation text from the Item.
261-
`links` | [[ID](#ID)] | A list of items corresponding to any intra-doc links in `docs` in order of appearance.
262-
`attrs` | [String] | The attributes (other than doc comments) on the Item, rendered as strings (e.g. `["#[inline]", "#[test]"]`).
262+
`links` | Map<String, [ID](#ID)> | A map of intra-doc link names to the IDs of the items they resolve to. For example if the `docs` string contained `"see [HashMap][std::collections::HashMap] for more details"` then `links` would have `"std::collections::HashMap": "<some id>"`.
263+
`attrs` | [String] | The [unstable](#Unstable) stringified attributes (other than doc comments) on the Item (e.g. `["#[inline]", "#[test]"]`).
263264
`deprecation` | [Deprecation](#Deprecation) | (*Optional*) Information about the Item's deprecation, if present.
264265
`kind` | String | The kind of Item this is. Determines what fields are in `inner`.
265266
`inner` | Object | The type-specific fields describing this Item. Check the `kind` field to determine what's available.
@@ -368,11 +369,11 @@ Name | Type | Description
368369
`is_unsafe` | bool | Whether this impl is for an unsafe trait.
369370
`generics` | [Generics](#Generics) | Information about the impl's type parameters and `where` clauses.
370371
`provided_trait_methods` | [String] | The list of names for all provided methods in this impl block. This is provided for ease of access if you don't need more information from the `items` field.
371-
`trait` | [Type](#Type) | (*Optional*) The trait being implemented or `null` if the impl is "inherent".
372+
`trait` | [Type](#Type) | (*Optional*) The trait being implemented or `null` if the impl is "inherent", which means `impl Struct {}` as opposed to `impl Trait for Struct {}`.
372373
`for` | [Type](#Type) | The type that the impl block is for.
373374
`items` | [[ID](#ID)] | The list of associated items contained in this impl block.
374375
`negative` | bool | Whether this is a negative impl (e.g. `!Sized` or `!Send`).
375-
`synthetic` | bool | Whether this is an impl that's implied by the compiler (for autotraits).
376+
`synthetic` | bool | Whether this is an impl that's implied by the compiler (for autotraits, e.g. `Send` or `Sync`).
376377
`blanket_impl` | String | (*Optional*) The name of the generic parameter used for the blanket impl, if this impl was produced by one. For example `impl<T, U> Into<U> for T` would result in `blanket_impl == "T"`.
377378

378379
### `kind == "constant"`

0 commit comments

Comments
 (0)