@@ -20,6 +20,8 @@ use super::{
2020 } ,
2121 utils,
2222} ;
23+ #[ cfg( doc) ]
24+ use crate :: report:: models;
2325use crate :: report:: {
2426 pyreport:: { types:: * , CHUNKS_FILE_END_OF_CHUNK , CHUNKS_FILE_HEADER_TERMINATOR } ,
2527 Report , ReportBuilder ,
@@ -28,7 +30,7 @@ use crate::report::{
2830#[ derive( PartialEq , Debug ) ]
2931pub struct ChunkCtx {
3032 /// The index of this chunk in the overall sequence of chunks tells us which
31- /// [`crate::report:: models::SourceFile`] this chunk corresponds to.
33+ /// [`SourceFile`]( models::SourceFile) this chunk corresponds to.
3234 pub index : usize ,
3335
3436 /// Each line in a chunk corresponds to a line in the source file.
@@ -44,7 +46,7 @@ pub struct ParseCtx<R: Report, B: ReportBuilder<R>> {
4446
4547 /// Tracks the labels that we've already added to the report. The key is the
4648 /// identifier for the label inside the chunks file and the value is the
47- /// ID of the [`crate::report:: models::Context`] we created for it in
49+ /// ID of the [`Context`]( models::Context) we created for it in
4850 /// the output. If a `"labels_index"` key is present in the chunks file
4951 /// header, this is populated all at once and the key is a numeric ID.
5052 /// Otherwise, this is populated as new labels are encountered and the key
@@ -55,12 +57,12 @@ pub struct ParseCtx<R: Report, B: ReportBuilder<R>> {
5557 pub chunk : ChunkCtx ,
5658
5759 /// The output of the report JSON parser includes a map from `chunk_index`
58- /// to the ID of the [`crate::report:: models::SourceFile`] that the
60+ /// to the ID of the [`SourceFile`]( models::SourceFile) that the
5961 /// chunk corresponds to.
6062 pub report_json_files : HashMap < usize , i64 > ,
6163
6264 /// The output of the report JSON parser includes a map from `session_id` to
63- /// the ID of the [`crate::report:: models::Context`] that the session
65+ /// the ID of the [`Context`]( models::Context) that the session
6466 /// corresponds to.
6567 pub report_json_sessions : HashMap < usize , i64 > ,
6668}
@@ -121,8 +123,8 @@ pub fn coverage<S: StrStream, R: Report, B: ReportBuilder<R>>(
121123 . parse_next ( buf)
122124}
123125
124- /// Parses the coverage type described by a `ReportLine`. Beware: this field may
125- /// be inaccurate.
126+ /// Parses the coverage type described by a [ `ReportLine`] . Beware: this field
127+ /// may be inaccurate.
126128///
127129/// For example, in a chunks file for a Go project, the "coverage type" field is
128130/// always `null` when some of the values in the "coverage" field indicate the
@@ -141,7 +143,8 @@ pub fn coverage_type<S: StrStream, R: Report, B: ReportBuilder<R>>(
141143 . parse_next ( buf)
142144}
143145
144- /// Parses value of the "complexity" field in a `ReportLine` or `LineSession`.
146+ /// Parses value of the "complexity" field in a [`ReportLine`] or
147+ /// [`LineSession`].
145148///
146149/// Examples: `1`, `3`, `[0, 1]`, `[2, 2]`
147150pub fn complexity < S : StrStream , R : Report , B : ReportBuilder < R > > (
@@ -218,9 +221,9 @@ where
218221 . parse_next ( buf)
219222}
220223
221- /// Parses values in the "partials" field of a `LineSession`. These values don't
222- /// necessarily have to do with partial branch coverage; what they describe is
223- /// the coverage status of different subspans of a single line.
224+ /// Parses values in the "partials" field of a [ `LineSession`] . These values
225+ /// don't necessarily have to do with partial branch coverage; what they
226+ /// describe is the coverage status of different subspans of a single line.
224227///
225228/// Examples:
226229/// - `[null, 10, 0]`: This line was not covered from its start until column 10
@@ -254,7 +257,7 @@ pub fn partial_spans<S: StrStream, R: Report, B: ReportBuilder<R>>(
254257}
255258
256259/// Parses a [`LineSession`]. Each [`LineSession`] corresponds to a
257- /// [`crate::report:: models::CoverageSample`] in the output report.
260+ /// [`CoverageSample`]( models::CoverageSample) in the output report.
258261///
259262/// A [`ReportLine`] has a [`LineSession`] for each upload ("session") sent to
260263/// us for a commit. The [`LineSession`] contains the coverage measurements for
@@ -346,7 +349,7 @@ pub fn label<S: StrStream, R: Report, B: ReportBuilder<R>>(
346349///
347350/// Technically `_coverage_type` is optional, but the way it gets serialized
348351/// when it's missing is identical to the way we serialize
349- /// [`crate::report::models:: CoverageType::Line`] so there's no way to tell
352+ /// [`CoverageType::Line`] so there's no way to tell
350353/// which it is when deserializing.
351354pub fn coverage_datapoint < S : StrStream , R : Report , B : ReportBuilder < R > > (
352355 buf : & mut ReportOutputStream < S , R , B > ,
@@ -369,11 +372,12 @@ pub fn coverage_datapoint<S: StrStream, R: Report, B: ReportBuilder<R>>(
369372
370373/// Parses a [`ReportLine`]. A [`ReportLine`] itself does not correspond to
371374/// anything in the output, but it's an umbrella that includes all of the data
372- /// tied to a line/[`CoverageSample`].
375+ /// tied to a line/[`CoverageSample`](models::CoverageSample) .
373376///
374377/// This parser performs all the writes it can to the output
375- /// stream and only returns a `ReportLine` for tests. The `report_line_or_empty`
376- /// parser which wraps this and supports empty lines returns `Ok(())`.
378+ /// stream and only returns a [`ReportLine`] for tests. The
379+ /// `report_line_or_empty` parser which wraps this and supports empty lines
380+ /// returns `Ok(())`.
377381pub fn report_line < ' a , S , R : Report , B : ReportBuilder < R > > (
378382 buf : & mut ReportOutputStream < S , R , B > ,
379383) -> PResult < ReportLine >
0 commit comments