Skip to content
Merged
Prev Previous commit
Next Next commit
document erros returned from try_parse_sized
  • Loading branch information
etseidl committed Sep 23, 2024
commit a4943a1dfcd076b912d6113e6be25d666320d1c0
Binary file removed parquet/src/.format.rs.swp
Binary file not shown.
Binary file not shown.
11 changes: 9 additions & 2 deletions parquet/src/file/metadata/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl ParquetMetaDataReader {
///
/// This call will consume `self`.
///
/// Example
/// # Example
/// ```no_run
/// # use parquet::file::metadata::ParquetMetaDataReader;
/// # fn open_parquet_file(path: &str) -> std::fs::File { unimplemented!(); }
Expand Down Expand Up @@ -166,7 +166,14 @@ impl ParquetMetaDataReader {
///
/// Using this function also allows for retrying with a larger buffer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would help here to document what errors are returned (specifically how "needs more buffer" is communicated)

I see it is partly covered in the example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

///
/// Example
/// # Errors
///
/// This function will return [`ParquetError::IndexOutOfBound`] in the event `reader` does not
/// provide enough data to fully parse the metadata (see example below).
///
/// Other errors returned include [`ParquetError::General`] and [`ParquetError::EOF`].
///
/// # Example
/// ```no_run
/// # use parquet::file::metadata::ParquetMetaDataReader;
/// # use parquet::errors::ParquetError;
Expand Down