Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(http/retry): document ReplayBody::poll_*() panics #3582

Merged
merged 1 commit into from
Jan 30, 2025
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
14 changes: 14 additions & 0 deletions linkerd/http/retry/src/replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ where
type Data = Data;
type Error = Error;

/// Polls for the next chunk of data in this stream.
///
/// # Panics
///
/// This panics if another clone has currently acquired the state. A [`ReplayBody<B>`] MUST
/// NOT be polled until the previous body has been dropped.
fn poll_data(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
Expand Down Expand Up @@ -248,6 +254,14 @@ where
Poll::Ready(Some(Ok(Data::Initial(chunk))))
}

/// Polls for an optional **single** [`HeaderMap`] of trailers.
///
/// This function should only be called once `poll_data` returns `None`.
///
/// # Panics
///
/// This panics if another clone has currently acquired the state. A [`ReplayBody<B>`] MUST
/// NOT be polled until the previous body has been dropped.
fn poll_trailers(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
Expand Down
Loading