Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Added lifetime parameter to async IPC reader. (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dexter Duckworth authored Feb 17, 2022
1 parent 107f118 commit 3bb4144
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/io/ipc/read/stream_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ async fn maybe_next<R: AsyncRead + Unpin + Send>(
}

/// A [`Stream`] over an Arrow IPC stream that asynchronously yields [`Chunk`]s.
pub struct AsyncStreamReader<R: AsyncRead + Unpin + Send + 'static> {
pub struct AsyncStreamReader<'a, R: AsyncRead + Unpin + Send + 'a> {
metadata: StreamMetadata,
future: Option<BoxFuture<'static, Result<Option<StreamState<R>>>>>,
future: Option<BoxFuture<'a, Result<Option<StreamState<R>>>>>,
}

impl<R: AsyncRead + Unpin + Send + 'static> AsyncStreamReader<R> {
impl<'a, R: AsyncRead + Unpin + Send + 'a> AsyncStreamReader<'a, R> {
/// Creates a new [`AsyncStreamReader`]
pub fn new(reader: R, metadata: StreamMetadata) -> Self {
let state = ReadState {
Expand All @@ -178,7 +178,7 @@ impl<R: AsyncRead + Unpin + Send + 'static> AsyncStreamReader<R> {
}
}

impl<R: AsyncRead + Unpin + Send> Stream for AsyncStreamReader<R> {
impl<'a, R: AsyncRead + Unpin + Send> Stream for AsyncStreamReader<'a, R> {
type Item = Result<Chunk<Arc<dyn Array>>>;

fn poll_next(
Expand Down

0 comments on commit 3bb4144

Please sign in to comment.