pub struct StackConcat<A, B>(pub A, pub B);Expand description
Concatenates two arm stacks into one, running both concurrently.
Arm indices from A are 0..A::SIZE; arm indices from B are offset
by A::SIZE. Outputs are (A::Outputs, B::Outputs).
Tuple Fields§
§0: A§1: BTrait Implementations§
Source§impl<'de, KP, A, B> MapArmStack<'de, KP> for StackConcat<A, B>
impl<'de, KP, A, B> MapArmStack<'de, KP> for StackConcat<A, B>
const SIZE: usize
Source§type Outputs = (<A as MapArmStack<'de, KP>>::Outputs, <B as MapArmStack<'de, KP>>::Outputs)
type Outputs = (<A as MapArmStack<'de, KP>>::Outputs, <B as MapArmStack<'de, KP>>::Outputs)
Left-nested tuple of
Option<(K, V)> for each arm.type RaceState = ConcatRaceState<<A as MapArmStack<'de, KP>>::RaceState, <B as MapArmStack<'de, KP>>::RaceState>
type DispatchState = ConcatDispatchState<<A as MapArmStack<'de, KP>>::DispatchState, <B as MapArmStack<'de, KP>>::DispatchState>
Source§fn unsatisfied_count(&self) -> usize
fn unsatisfied_count(&self) -> usize
Number of arms that still require a value (required fields not yet matched).
Virtual arms are excluded.
Source§fn open_count(&self) -> usize
fn open_count(&self) -> usize
Number of arms still willing to run, including virtual arms.
fn init_race(&mut self, kp: KP) -> Self::RaceState
fn poll_race_one( &mut self, state: Pin<&mut Self::RaceState>, arm_index: usize, cx: &mut Context<'_>, ) -> Poll<Result<Probe<(usize, KP::KeyClaim)>, KP::Error>>
fn init_dispatch( &mut self, arm_index: usize, vp: VP<'de, KP>, ) -> Self::DispatchState
fn poll_dispatch( &mut self, state: Pin<&mut Self::DispatchState>, cx: &mut Context<'_>, ) -> Poll<Result<Probe<(VC<'de, KP>, ())>, KP::Error>>
fn take_outputs(&mut self) -> Self::Outputs
Source§impl<KP, A, B> MapArmStackOwned<KP> for StackConcat<A, B>
impl<KP, A, B> MapArmStackOwned<KP> for StackConcat<A, B>
const SIZE: usize
Source§type Outputs = (<A as MapArmStackOwned<KP>>::Outputs, <B as MapArmStackOwned<KP>>::Outputs)
type Outputs = (<A as MapArmStackOwned<KP>>::Outputs, <B as MapArmStackOwned<KP>>::Outputs)
Left-nested tuple of
Option<(K, V)> for each arm.Source§type RaceState = ConcatRaceState<<A as MapArmStackOwned<KP>>::RaceState, <B as MapArmStackOwned<KP>>::RaceState>
type RaceState = ConcatRaceState<<A as MapArmStackOwned<KP>>::RaceState, <B as MapArmStackOwned<KP>>::RaceState>
Pinned state holding per-arm key futures for one round of racing.
Source§type DispatchState = ConcatDispatchState<<A as MapArmStackOwned<KP>>::DispatchState, <B as MapArmStackOwned<KP>>::DispatchState>
type DispatchState = ConcatDispatchState<<A as MapArmStackOwned<KP>>::DispatchState, <B as MapArmStackOwned<KP>>::DispatchState>
Pinned state for dispatching the winning arm’s value callback.
Only one arm is dispatched per call (the race winner).
Source§fn unsatisfied_count(&self) -> usize
fn unsatisfied_count(&self) -> usize
Number of arms that still require a value (required fields not yet matched).
Virtual arms (skip-unknown, dup-detect, tag-inject) are excluded.
Source§fn open_count(&self) -> usize
fn open_count(&self) -> usize
Number of arms still willing to run, including both unsatisfied
required-field arms and always-active virtual arms.
Source§fn init_race(&mut self, kp: KP) -> Self::RaceState
fn init_race(&mut self, kp: KP) -> Self::RaceState
Fork
kp for each unsatisfied arm, call each arm’s key callback to
create its future, and return the combined pinned state.Source§fn poll_race_one(
&mut self,
state: Pin<&mut Self::RaceState>,
arm_index: usize,
cx: &mut Context<'_>,
) -> Poll<Result<Probe<(usize, KP::KeyClaim)>, KP::Error>>
fn poll_race_one( &mut self, state: Pin<&mut Self::RaceState>, arm_index: usize, cx: &mut Context<'_>, ) -> Poll<Result<Probe<(usize, KP::KeyClaim)>, KP::Error>>
Poll a single arm’s key future. Sync - recursion through
(Rest, Slot) is ordinary function calls, not async nesting.Source§fn init_dispatch(&mut self, arm_index: usize, vp: VP<KP>) -> Self::DispatchState
fn init_dispatch(&mut self, arm_index: usize, vp: VP<KP>) -> Self::DispatchState
Create the dispatch state for the winning arm at
arm_index.Source§fn poll_dispatch(
&mut self,
state: Pin<&mut Self::DispatchState>,
cx: &mut Context<'_>,
) -> Poll<Result<Probe<(VC<KP>, ())>, KP::Error>>
fn poll_dispatch( &mut self, state: Pin<&mut Self::DispatchState>, cx: &mut Context<'_>, ) -> Poll<Result<Probe<(VC<KP>, ())>, KP::Error>>
Poll the dispatch future.
Source§fn take_outputs(&mut self) -> Self::Outputs
fn take_outputs(&mut self) -> Self::Outputs
Extract all outputs.
Auto Trait Implementations§
impl<A, B> Freeze for StackConcat<A, B>
impl<A, B> RefUnwindSafe for StackConcat<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for StackConcat<A, B>
impl<A, B> Sync for StackConcat<A, B>
impl<A, B> Unpin for StackConcat<A, B>
impl<A, B> UnsafeUnpin for StackConcat<A, B>where
A: UnsafeUnpin,
B: UnsafeUnpin,
impl<A, B> UnwindSafe for StackConcat<A, B>where
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more