macro_rules! handle_state { ($match_case:expr) => { ... }; }
Expand description
The handle_state
macro is designed to process the result of a state-changing
operation. It operates on a StatefulStreamResult
by matching its variants and
executing corresponding actions. This macro is used to streamline code that deals
with state transitions, reducing boilerplate and improving readability.
§Cases
Ok(StatefulStreamResult::Continue)
: Continues the loop, indicating the stream join operation should proceed to the next step.Ok(StatefulStreamResult::Ready(result))
: Returns aPoll::Ready
with the result, either yielding a value or indicating the stream is awaiting more data.Err(e)
: Returns aPoll::Ready
containing an error, signaling an issue during the stream join operation.
§Arguments
$match_case
: An expression that evaluates to aResult<StatefulStreamResult<_>>
.