Skip to content

Commit

Permalink
Update parquet/src/arrow/async_reader/mod.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Jay Zhan <jayzhan211@gmail.com>
  • Loading branch information
ethe and jayzhan211 authored Nov 20, 2024
1 parent ca9d1a8 commit c8a25d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions parquet/src/arrow/async_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ pub trait AsyncFileReader: Send {
fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>;
}

/// Implements AsyncFileReader for boxed readers with an explicit lifetime 'reader.
/// This allows Box<dyn AsyncFileReader + 'reader> to be used as an AsyncFileReader,
/// which is needed when the boxed reader contains references with lifetimes
/// shorter than 'static.
impl<'reader> AsyncFileReader for Box<dyn AsyncFileReader + 'reader> {
fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>> {
self.as_mut().get_bytes(range)
Expand Down

0 comments on commit c8a25d8

Please sign in to comment.