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

Add lifetime parameterization to async IPC reader #851

Merged
merged 2 commits into from
Feb 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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