From 10f17ba7ddafc5f5b6900fe7f15095464041798b Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 20 Aug 2024 11:49:11 -0400 Subject: [PATCH] Improve documentation and add links --- arrow-flight/src/streams.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/arrow-flight/src/streams.rs b/arrow-flight/src/streams.rs index 220f7b874624..e532a80e1ebb 100644 --- a/arrow-flight/src/streams.rs +++ b/arrow-flight/src/streams.rs @@ -78,11 +78,19 @@ impl Stream for FallibleRequestStream { } } -/// Wrapper for a tonic response stream that can produce a tonic -/// error. This is tied to a oneshot receiver which can be notified -/// of other errors. When it receives an error through receiver -/// end, it prioritises that error to be sent back. See `do_put` or -/// `do_exchange` for it's uses +/// Wrapper for a tonic response stream that maps errors to `FlightError` and +/// returns errors from a oneshot channel into the stream. +/// +/// The user of this stream can inject an error into the response stream using +/// the one shot receiver. This is used to propagate errors in +/// [`FlightClient::do_put`] and [`FlightClient::do_exchange`] from the client +/// provided input stream to the response stream. +/// +/// # Error Priority +/// Error from the receiver are prioritised over the response stream. +/// +/// [`FlightClient::do_put`]: crate::FlightClient::do_put +/// [`FlightClient::do_exchange`]: crate::FlightClient::do_exchange pub(crate) struct FallibleTonicResponseStream { /// Receiver for FlightError receiver: Receiver,